
Code Review: xz/liblzma Backdoor
Diving into commits made by the xz/liblzma actors to look for interesting behaviors and artifacts.
The basis upon which this multi-part segment builds from is taking our knowledge as a user of technology and applying it toward security awareness. Coming from a background in technology is a benefit for many reasons, but foremost is that understanding how people use technology is as important to security as understanding the technology itself.
The overall focus of this multi-part segment will be understanding core elements for initial or further learning into the cybersecurity space.
Understanding the difference between vulnerabilities, threats, and risk.
Our job as practitioners is to interpret disparate data in such a way that allows us to establish risk profiles. When evaluating individual or combined technologies it is far more likely that you will find a system with risks than one without, and those risks may be derived from one or many sources within a system.
Understanding surface risk in a system is dependent upon knowing two pieces of information; vulnerabilities of the system and threats to it. Vulnerabilities are weaknesses that may be inherent or conditional, while threats are people or things that may exploit those vulnerabilities.
When it comes to businesses we need a little more data because we need to be able to classify and convey the severity of this risk as something measurable to the business. So once we know the surface risk we evaluate how critical the data or systems that hold this risk are to business functions, and then assess compensating controls that may diminish damages from a vulnerability. From this perspective we should be able to classify and communicate the severity of this risk to the business, and then prioritize a response.
An easily available resource, let us focus on yourself as a daily driver of your computer. Whether you use Windows, MacOS, or Linux some aspect of your computer is being provided or maintained by an upstream entity. We will focus on this circumstance for this example.
In this circumstance we identify that some popular application could be compromised, and they install a keylogger on personal computers. On the surface this could be pretty bad if you do a lot of banking or work from your personal computer.
If you don’t use your personal computer for banking or work, and you do run anti-virus and use MFA, then the likelihood of you being adversely impacted is probably much lower than someone who uses their personal computer for everything. So for this example, the surface risk would be high, but the measured risk may be closer to “low” or “moderate”. You would still want to be proactive and rotate passwords regardless.
Web applications are fairly ubiquitous in the modern world. Many phone applications, home appliances, and even cars run them as a component of their user interface or as extended functionality. For this example, we will focus on a fake website called PassportPipeline, which helps expedite the passport application process for people who don’t have the time or energy to do it themselves.
PassportPipeline is run by a small business, and so they only have one IT systems administrator (sysadmin) to manage their cloud infrastructure. The IT sysadmin also tends to wear a security hat when it comes to patching and configuration standards. Today our IT sysadmin gets asked to join a morning check-in meeting with the DevOps team. Upon joining, our IT sysadmin is notified of a potential issue with software the DevOps team uses to manage their website.
One of the developers for PassportPipeline happens to be security conscious, and regularly checks security bulletins published for software the DevOps team uses for managing the website. This morning they noticed that there is a new vulnerability for their CMS (Content Management System), that gives unauthenticated users with access to the admin portal the ability to execute commands on the server hosting the CMS as an administrative user.
What’s more, DevOps does not think they will be able to patch to a fixed version for at least 4 weeks due to a freeze in code changes the CIO implemented last month in an attempt to improve platform stability metrics. They’ve asked the IT sysadmin to review the configuration on the servers and let them know of any potential changes they could make to better secure the servers until the updated code can be deployed.
Since the IT sysadmin is already fairly knowledgable about the server configuration, they are aware of a few things:
www.PassportPipeline.com
and cms.PassportPipeline.com
)Lets take pause for a moment, and think about this situation before chasing down severity. Put yourself in this situation, and consider what questions you might have in addition to the ones below.
What steps could you take to validate the vulnerability?
What questions could you ask the DevOps team to better understand the risk?
Are there any technologies inline with the website that could offer protection?
*.PassportPipeline.com
(severity remains high)The IT sysadmin considers this to be a critical problem, as there is no control in place to prevent someone from abusing the new vulnerability. Some action must be taken in short time to prevent abuse of their platform.
Unfortunately just blocking traffic to the CMS also means blocking customer traffic to the platform since they are hosted on the same servers. However, it does appear that there is an option to only forward specific hostnames (URLs) in the load balancer.
The IT sysadmin asks the DevOps team how they access the CMS portal today. The DevOps team says they use their jump host to access the admin portal directly (they do not use the load balancer).
The IT sysadmin puts together a change request, and gets approval to change the load balancers from wildcard “*” to “www”, which is approved by their management and DevOps leadership. The changes are implemented in an emergency change window, and the IT sysadmin verified the CMS website is no longer accessible from the internet.
Measured risk may be reduced slightly now, as someone must first have access to an adjacent server to exploit the vulnerability.
Given the period of unknown between the vulnerability being found and the IT sysadmin implementing a control, they would also likely need to take proactive measures to assess, monitor, and continuously evaluate the CMS environments for any suspicious activity while the DevOps team prepares to patch.
Takeaways:
Diving into commits made by the xz/liblzma actors to look for interesting behaviors and artifacts.
Automate the boring stuff with chat bots.