The backdoor hiding behind the person you trusted.
By Farida Khalaf
Published: 2026-10-19
URL: https://fafi25.substack.com/p/bee-trace-case-file-002-xz-backdoor
Small bee. Big questions. Bigger investigations. Lights On · Cybersecurity Series
Every Monday, Bee Trace traces one technical thing that touches many of us. Not your turf? Skip it. Know someone who’d learn from it? Send it their way.
October 29, 2021.
A message reaches the public xz-devel mailing list for XZ Utils, a data compression library. A newcomer using the name Jia Tan offers a small patch. It adds an .editorconfig file, a settings file that keeps code formatting consistent.
It is an ordinary patch. The maintainer is Lasse Collin, who designed the .xz format with help from others in the 2000s. Patches like it arrive on mailing lists all the time, and nobody has a reason to look twice.
More than two years later, on March 28, 2024, a security researcher named Andres Freund tells Debian and a private security list that he has found something in that same library. He had noticed failing SSH logins (SSH is the tool for logging in to servers remotely) under high CPU load, then slower logins. Investigating the CPU usage led him to xz.
Bee Trace started with a slow login.
The trail led somewhere she did not expect: to an account that had spent two years being helpful.
More than two years of patience, and one slow login.
🔎 Case File: What Exactly Is XZ Utils?
Before we get to the attack, one thing straight.
XZ Utils is not malware.
It is a data compression library, liblzma, plus tools that shrink files so they are smaller to store and send. Software uses it quietly in the background. It was doing something extremely ordinary.
The problem arrived in two releases, 5.6.0 and 5.6.1, published in February and March 2024. They carried a hidden backdoor, given the public ID CVE-2024-3094 and scored 10.0, Critical, on CVSS, the standard severity scale, where 10 is the top (Unit 42).
Ireland’s National Cyber Security Centre lists the score as CVSS v3.0. A severity score describes how bad a flaw could be, not whether a particular machine was compromised.
The place it hid is the first strange thing. Three layers are easy to confuse. The git source is the code reviewers read. The release tarball is the packaged download that distributions build from. The compiled library is what the build produces.
The disguised payload sat in binary test files in the repository. The modified build script that unpacked it and wired it into liblzma existed only in the release tarball (Cox). During the build, obfuscated steps pulled prebuilt compiled code out of a disguised test file (Unit 42). Reading the repository alone would not have shown the whole attack.
This is a different shape from Log4Shell. Log4Shell was a flaw in code. XZ was a backdoor put there on purpose, and it reached the code through the people and the process around it.
🐝 Bee Trace Sees Something Strange
Bee Trace pulls on a different thread this time. Not what the software depends on, but who the software depends on.
The chain: A helpful contributor → a maintainer’s trust → release tarball → liblzma → libsystemd → sshd
Bee Trace: “Wait. Who built this release?”
Russ Cox’s timeline of the xz backdoor lays out how the pieces fit, and it is worth reading in full. These are the dates that matter:
-
Oct 29, 2021: Jia Tan sends a first small patch to the xz-devel list.
-
Jun 10, 2022: Lasse Collin merges the first commit with Jia Tan as git author. Later that month he writes that Jia Tan is practically a co-maintainer already.
-
Dec 30, 2022: Jia Tan merges commits directly into the xz repository.
-
Mar 18, 2023: Jia Tan tags and builds the first release, 5.4.2.
-
Feb 23, 2024: Hidden backdoor code is merged inside binary test files.
-
Feb 24, 2024: Release 5.6.0 ships, with a modified build script in the tarball that adds the backdoor during package builds.
-
Mar 9, 2024: Release 5.6.1 ships.
-
Mar 28–29, 2024: Andres Freund reports it privately, then publicly.
Why was the door open? In May 2022 Collin wrote that his resources were too limited, and in June he called xz an unpaid hobby project. From April that year, accounts named Jigar Kumar and Dennis Ens pressed him on the mailing list to hand over more control. Cox judges it likely that these accounts were fakes created to push Collin to give Jia Tan more control (Cox).
Bee Trace does not blame the maintainer. Handing responsibility to a helpful contributor is how open source works. The lesson is about what a team can see, and what it checks, once trust is given.
One more piece explains why a compression library mattered to a login service. Some distributions patch OpenSSH’s sshd to link libsystemd, which pulls in liblzma. Arch, Gentoo and NixOS did not patch sshd that way, which Cox gives as the reason they were not affected through SSH. That is how a file-shrinking library ended up inside the program that guards remote logins.
🕵️ Then Bee Trace Finds the Clue
The clue was not a string in a log this time. It was a feeling of slowness. Here is how the backdoor reached a login, step by step:
-
A release tarball ships with a modified build script and disguised test files.
-
During the package build, hidden steps pull a prebuilt object file out of a test file.
-
That object file modifies liblzma, the compression library.
-
On distributions that link sshd to libsystemd, sshd loads liblzma when it starts.
-
The modified library can interfere with authentication in sshd. Under the right conditions, an attacker holding the specific key the backdoor expects could run commands remotely before normal SSH authentication completed (CERT-EU).
Reading the clue, one piece at a time
Andres Freund, a security researcher, did not set out to find a backdoor. Here is what the trail looked like:
-
Failing SSH logins under high CPU load. The first thing he noticed. In plain words: “Something is using more processor time than a login should.”
-
Then slower logins. A small delay, easy to ignore. In plain words: “The machine is doing extra work before it lets me in.”
-
Investigating the CPU usage. This led him to xz (Unit 42).
-
Earlier hints. Red Hat distributions began seeing errors from Valgrind, a memory-checking tool, in a liblzma function on March 4, and Gentoo reported crashes in 5.6.0 on February 24. The crashes were put down to a separate bug at the time (Cox).
Why does a slow login count as a lead? Because normal behavior is a baseline, and a hidden change has to run somewhere. Code that nobody planned for takes time and processor cycles, and a person who notices the difference has something to follow.
Bee Trace: “That’s not a compression problem. That’s a trust problem.”
🌐 Then She Zooms Out
The backdoored releases existed for about five weeks, from February 24 to the public warning on March 29. That is the window of exposure, not five weeks of confirmed exploitation. They reached several development and rolling-release distributions, including Fedora Rawhide and a Fedora 40 beta, Debian testing and unstable, Kali, openSUSE Tumbleweed and MicroOS, and some Arch packages and images. Debian stable was not affected, and Amazon Linux was reported as not affected (Unit 42, CERT-EU).
Having the backdoored package did not automatically make a system exploitable through SSH. That depended on the package build, the system’s libraries and how OpenSSH was linked. Assess each distribution against its own advisory, and don’t infer exposure from the xz version alone.
The same rule from Case File #001 applies: vulnerable is not the same as compromised. Each rung needs its own evidence:
-
Present: an affected version of xz exists on a machine.
-
Loaded: a program such as sshd actually loads the modified library.
-
Reachable: that program accepts connections from outside.
-
Used: someone tried to take advantage of it.
-
Post-use: the attacker did something next.
The first three can be checked today. The last two depend on records you may not have, so say so plainly in your report.
There is also a lesson in the timing. Debian stable did not carry the backdoored versions, and the discovery came while the releases were still in development and rolling channels. A slow login, noticed and followed, led to the discovery. The disclosure and the distributions’ fixes closed the window.
⚠️ But the Fix Wasn’t Only a Patch
Some projects changed how they build software, not just which version they run. The first change below came before the disclosure and was independent of it; the others followed it:
-
Mar 5, 2024: A systemd change removing liblzma from libsystemd is merged, independent of the later disclosure. Cox notes it would have defeated the attack.
-
Mar 28, 2024: Debian rolls back to an earlier xz. Arch changes 5.6.1 to build from Git.
-
Mar 30, 2024: Haiku OS moves to GitHub source snapshots.
The responses differed. Some projects rolled back to a known-good release; others changed their build inputs. They shared one concern, and it is the question this case leaves behind: does the thing you downloaded match the thing you reviewed?
🛡️ So What Should Bee Trace Do?
She doesn’t panic. She asks what was installed, and how it was built.
-
🔎 Know what you run. List which machines carry xz, and which version. The affected versions were 5.6.0 and 5.6.1 (Unit 42).
-
🧩 Find where it is loaded. Don’t stop at “Is xz installed?” Ask which programs load liblzma, and whether the exposed one, sshd, is among them on your distribution.
-
🛠️ Roll back or update, as your distribution says. CISA advised downgrading to a version earlier than 5.6.0 (Unit 42). Check your distribution’s security notice for its specific guidance.
-
👁️ Ask how it was built. A release package can differ from the source it claims to come from. Several projects chose to build from source after this case (Cox).
-
🔄 Verify, and look back. First contain: follow your distribution’s advisory and install a known-good package, starting with internet-facing hosts. Then investigate: which hosts ran 5.6.0 or 5.6.1, since when, and was the vulnerable SSH path present? Preserve and review authentication and system records for that window, and escalate to your incident-response process if compromise is suspected. A clean log search cannot prove a system was never compromised. Preserve evidence throughout.
🧰 Field kit for developers
Where those five steps point, here is how a developer can start. Every command below is a starting point to confirm against your distribution’s documentation.
What xz version is on this machine?
Start here: xz --version. The catch: this reports the command-line tool. The library, liblzma, is a separate package on many systems, so check your package manager too.
Which package version does my distribution say I have?
Start here: dpkg -l | grep xz on Debian-family systems, or rpm -q xz xz-libs on RPM-based ones. The catch: package names differ between distributions, and a distribution may have rolled back to an earlier build under the same version number, so read its security notice as well. Fixes can also be backported without changing the version number, so don’t rely on a version string alone.
Does the release I build from match the source I reviewed?
Start here: compare the contents of the release tarball against the tagged source in version control, file by file. The catch: in this case the script that activated the payload was in the tarball and not in the git repository (Cox), so reading only the repository would have missed it.
Is it inside a container image or a vendor product?
Start here: scan the image, and ask the vendor for an SBOM (a software bill of materials, a component inventory). The catch: a scan of your own source never sees what the image added. An image built while 5.6.0 or 5.6.1 was current in its distribution is the one to look for. An SBOM lists components without proving a build is safe or free of a backdoor.
Did anyone use it on us?
Start here: list the hosts that ran 5.6.0 or 5.6.1 with SSH reachable, and the dates, then review login records for that window. The catch: there is no simple string to search for, and the backdoor was built to be hard to see, so a clean result proves little. Logs are one source of evidence among several; add network records and endpoint data where you have them.
These are starting points, and version strings and package lists are first checks, not proof that a build was vulnerable or that a fix worked. Confirm each against current documentation before you rely on it, and keep the results as evidence: what you checked, when, and what you found.
🎯 Your Turn, Detective
Bee Trace hands you the magnifying glass.
Bee Trace: “It’s March 29, 2024. A server in your fleet runs xz 5.6.1 and accepts SSH logins from the internet. What’s your move?”
A. Wait for your distribution’s next scheduled update; leave it running until then.
B. Read the project’s GitHub source, find nothing odd, and call it safe.
C. Follow your distribution’s advisory: install a safe version, then investigate exposure.
D. Rebuild every server in the company, whatever version it runs.
Vote in the poll below. The answer, and how you voted, open Case File #003.
Case File #001: Log4Shell — answer: B.
-
B: find every copy, patch it, and check for use before the patch.
-
A: fails because on December 12, 2021 the newest release was 2.15.0, and its fix turned out to be incomplete.
-
C: fails because a clean search for one string proves little once attackers disguised it.
-
D: fails because vulnerable is not the same as compromised, and treating everything as breached tells you nothing about what actually happened. B works because it finds, fixes, verifies and looks back.
🐝 Bee Trace’s Conclusion
She closes the case file.
But she doesn’t close the investigation.
Log4Shell was an exploitable vulnerability in code. XZ was a deliberately planted backdoor that reached the code through trust in the people and processes that build and distribute software. That changes what a defender has to ask: you are responsible not only for what you depend on, but for how it was built, and who built it.
The backdoor was found because a researcher asked why logins had slowed down and kept following the answer. The habit worth keeping: treat a small change in behavior as a lead, and chase it.
Bee Trace: “Find it. Explain it. Fix it. Then check what you missed.”
🐝 Bee Trace is watching.
CASE FILE #002: XZ UTILS. STATUS: CAUGHT.
NEXT CASE: UNKNOWN.
Case File #002: XZ Utils
-
Case: CVE-2024-3094, the XZ Utils backdoor
-
Target: XZ Utils / liblzma 5.6.0 and 5.6.1 release tarballs; exposure depended on how a distribution built and linked sshd
-
Threat: A backdoor aimed at SSH servers. CVSS 10.0, Critical (Unit 42)
-
Reported: March 28, 2024, by Andres Freund to Debian and a private security list (Cox)
-
Public: March 29, 2024
-
Earliest trace: October 29, 2021: first patch from the Jia Tan account. Backdoor code merged February 23, 2024 (Cox)
-
Trace: Contributor → maintainer trust → release tarball → build → liblzma → libsystemd → sshd
-
Protection: Inventory · find where it loads · roll back or update · ask how it was built · verify and look back
-
Core lesson: Trust is part of the supply chain. Check how the thing was built, not only what it contains.
-
Status: Caught, March 2024
Lights On · Cybersecurity Series. Understand. Detect. Stay ahead.
The magnifying glass is down, but Bee Trace is always watching. 🔍🐝
Until next time,
Lights On . Cybersecurity Series
