Blog/Incident analysis

The xz-utils backdoor: two years of patience, caught by accident

A trusted co-maintainer hid an SSH backdoor in xz release tarballs. It scored 10.0 and was found because one engineer thought logins felt slow.

CyberWatch AI26 November 2026 · 8 min read
A terminal window filled with white text on a black background on a desktop monitor

Andres Freund thought his SSH logins felt slow. Failed ones were taking about 0.8 seconds on a Debian unstable machine, where they had previously taken around 0.3, and some unrelated work with valgrind had been producing odd errors. He went looking for the cause out of irritation rather than suspicion.

The cause was a backdoor in liblzma, the compression library shipped as part of xz-utils, deliberately placed there by someone who had spent roughly two years earning the right to commit to the project. It allowed an attacker holding the matching private key to run code through SSH before authentication finished. It was assigned CVE-2024-3094 and scored 10.0, the maximum.

Freund has been consistent in pointing out that he is not a security researcher or a reverse engineer. The most sophisticated open-source supply chain attack yet documented was found by a database developer who noticed a third of a second.

The long approach

The timeline matters more than the code, and Russ Cox's compilation of the public mailing list and repository record lays it out in a way worth reading in full.

An account using the name Jia Tan, handle JiaT75, first appeared on the xz development list in October 2021 with an entirely innocuous patch adding an editor configuration file. Over the following months it contributed real, useful work.

In parallel, through 2022, other accounts began pressing the project's long-standing maintainer, Lasse Collin, about slow progress and the need for a maintainer change. Collin's replies are difficult to read. He explained that he worked on xz unpaid, in limited time, and referred to his own mental health. He mentioned that Jia Tan had been helping him off-list and might take a larger role.

Many of the email addresses used in that pressure campaign appear nowhere else on the internet. The pattern it describes is social engineering of an exhausted volunteer, applied over months, by what appear to be accounts coordinated with the person who benefited from it.

It worked. The first commit authored by Jia Tan and merged by Collin lands in June 2022. The GitHub handle was added to the project organization in October 2022. By the end of that year Jia Tan was merging directly. In March 2023 Jia Tan tagged and built a release, which is the moment that matters: release authority means control over the tarball, and the tarball is not the repository.

Where the code hid

An xz release tarball is not simply an export of the git tree. It is generated, and it includes build-system files produced by autotools that are not checked in. That gap is where the attack lived.

Version 5.6.0 was tagged and built in February 2024. Its tarball contained a modified build-to-host.m4, a build-system file absent from the repository, carrying an obfuscated script that ran at the end of configure.

The script was choosy about when to act. Freund's analysis records that it checked for x86-64 Linux with glibc, GCC and GNU ld, and for the signs of a Debian or RPM package build. Satisfied, it modified the liblzma makefile to decompress one of the project's test files and pipe the result into a shell.

The payload itself was in the repository, as two files under the test directory: one named as a corrupted lzma2 sample, one as a large compressed sample. Binary test fixtures in a compression library are completely unremarkable. Nobody reads them, because there is nothing to read. Freund notes that in 5.6.0 those files were not used by any test.

So the review surfaces all came back clean. The git history showed sensible commits. The source code contained no malicious logic. The suspicious build file was not in the repository anyone would review, and the payload was in files whose entire purpose is to be meaningless.

How it reached SSH

The injected object replaced two of liblzma's indirect function resolvers, the ones the dynamic linker calls at startup to select an optimized CRC implementation. That got the backdoor executing during process initialization, and because sshd on affected systems is linked with immediate binding, those symbols resolve early.

It then installed an audit hook in the dynamic linker, waited for RSA_public_decrypt to be resolved, and redirected that function's entry to its own code. Public-key authentication therefore passed through attacker-controlled code before the login decision was taken. Freund's initial post was careful to say he suspected unauthorized access or remote code execution without having fully confirmed what the hook checked; subsequent analysis established that it looked for a signature made with a key only the attacker held.

There is a wrinkle that explains the uneven impact. OpenSSH does not link liblzma. Several distributions patch sshd so it can report readiness to systemd, which links libsystemd, which links liblzma. The attack reached SSH through a dependency that exists because of a distribution integration patch, three links away from the library that was actually compromised. Whoever built this understood the packaging ecosystem in detail.

The code also checked environment variables and the presence of debugging tools, and behaved differently when it suspected it was being examined.

Caught in time, barely

Freund discovered the problem on 28 March 2024 and notified Debian and the distros list privately. Debian rolled the package back the same day and Red Hat assigned the CVE. On 29 March he posted the public warning to oss-security.

The exposure window was short because 5.6.x had mostly reached rolling and pre-release distributions rather than stable ones. Red Hat's advisory states plainly that no versions of Red Hat Enterprise Linux are affected, with the packages present only in Fedora development and pre-release streams. Debian's unstable and testing branches had carried them for a few weeks. CISA's alert named 5.6.0 and 5.6.1 and recommended downgrading to 5.4.6.

What makes this uncomfortable is the record of what was happening in the days before discovery. Bug reports and emails asking distributions to move to 5.6.1 were filed in late March, including to Fedora, Debian and Ubuntu, some of them by the Jia Tan account itself. The attack was weeks away from reaching long-term-support releases that run a large share of the world's internet-facing Linux servers. The reason it did not is that one person found a performance regression annoying.

What is confirmed and what is not

Confirmed: the affected versions, the CVE and its score, the mechanism in the detail above, the commit and release history, the pressure campaign emails, the discovery and disclosure dates, and which distribution families were and were not exposed. All of it sits in public mailing list archives, public repositories and vendor advisories.

Not established: who Jia Tan actually was. The sophistication, the patience and the operational discipline have led many analysts to suspect a well-resourced state programme, and that is a reasonable inference rather than a finding. No government or law enforcement body has published a formal attribution, and no arrest has been announced. Freund's own assessment in his disclosure was limited to the observation that the committer's involvement, or a severe compromise of their system, was the only plausible explanation for the pattern of activity.

Also unknown: whether the backdoor was ever used against anyone, and whether the same actor placed anything elsewhere. Reviews of other projects followed, and the absence of further confirmed findings is not the same as evidence that there are none.

What to take from it

The honest starting point is that most of the usual advice would not have caught this. Dependency scanning would have reported a current, legitimate version of a well-known library. Signature verification would have passed. A code review of the commits would have found competent work. The package was not typosquatted, abandoned or obscure; xz is a core compression utility present on essentially every Linux system.

What follows is still worth doing, with that caveat attached.

Build from version control rather than from generated tarballs where you reasonably can. The entire trigger lived in a file that exists only in the release artifact. This is also the argument for reproducible builds, where an independent rebuild of the same source must produce identical output, because a discrepancy between source and artifact is exactly what that technique detects.

Prefer stable distribution packages for infrastructure. The conservatism of long-term-support releases, usually experienced as an irritation, is what protected most production systems here. Running the newest version of everything is a security posture with costs as well as benefits.

Reduce what gets loaded into security-critical processes. A compression library ended up inside the authentication path of a remote access daemon because of a service notification patch. Nobody designed that; it accumulated. Periodically asking what is actually linked into your most sensitive processes is cheap and occasionally alarming.

Know your dependencies, including the transitive ones. A software bill of materials would not have flagged this as malicious, but it answers the question every organization scrambled to answer that weekend: do we run this, and where? Being able to answer in minutes rather than days is the whole value. Our supply chain security guide covers how to build that inventory, and supply chain attacks sets out the broader category.

Treat maintainer burnout as a security issue, because it is one. The opening the attacker used was a tired, unpaid volunteer maintaining critical infrastructure alone and being told he was too slow. Organizations that depend on open source, which is all of them, have a direct interest in funding and staffing the projects they rely on. That is not charity; it is the cheapest available control against this specific attack pattern, and no amount of scanning substitutes for it.

For the defensive program around all of this, our vulnerability management guide covers how to turn an advisory like CVE-2024-3094 into action quickly, and the incident response guide covers what to do when the answer to "do we run this?" turns out to be yes.

Got an urgent message about patching a critical vulnerability? Fake advisories and malicious "patch now" links follow every high-profile CVE. Paste the message or link into CyberWatch AI Scan for a free check.

The detail that stays with people is the near miss. Two years of preparation, a payload invisible to every automated and human review the ecosystem had, aimed at the authentication path of the most widely deployed remote access service on the internet, and it was stopped weeks short of general release by a developer chasing down half a second of latency he could not explain. That is not a defense anyone can plan around, and it is the clearest possible argument for building ones that can be.

Frequently asked questions

What was the xz-utils backdoor?

Malicious code hidden in the official release tarballs of xz versions 5.6.0 and 5.6.1. During the build it extracted a payload from files disguised as compression test data and injected it into liblzma, which allowed an attacker holding the right private key to run code on affected systems through SSH before authentication completed.

What is the CVE and how severe was it?

CVE-2024-3094, with a CVSS base score of 10.0 and the weakness classified as CWE-506, embedded malicious code. Ten is the maximum; the vector reflects a network attack needing no privileges and no user interaction, with scope change and high impact to confidentiality, integrity and availability.

Was it an attack or a mistake?

An attack, and an extraordinarily patient one. The code was deliberately obfuscated, deliberately hidden from the git repository, and placed by an account that had spent roughly two years building standing in the project.

How was it discovered?

Andres Freund noticed that failed SSH logins on a Debian unstable machine were using an unusual amount of CPU, around 0.8 seconds against about 0.3 before, alongside some valgrind errors. He traced the cause to liblzma, then used performance tracing and a debugger to find where execution diverged. He has said publicly that he is not a security researcher or reverse engineer.

Which systems were actually affected?

Mainly rolling and pre-release distributions. Red Hat's advisory states that no versions of Red Hat Enterprise Linux are affected, with exposure limited to Fedora development and pre-release streams. Debian's unstable and testing branches carried the packages briefly and rolled back. Stable, long-term-support Linux distributions were largely untouched because they had not moved to 5.6.x.

Why was the code not visible in the source repository?

The trigger lived in build-to-host.m4, a build-system file present in the generated release tarball but not in the git tree. The payload itself was committed to the repository, but disguised as binary test files for corrupt and large compressed input, where opaque binary blobs are entirely normal.

How did it reach SSH, which does not use xz?

OpenSSH does not link liblzma. Several distributions patch sshd to support systemd service notification, which links libsystemd, which links liblzma. The backdoor reached sshd through that chain, which is why it affected some distributions and not others.

What did the backdoor hook?

It replaced the CRC function resolvers that the dynamic linker calls at startup, then used a linker audit hook to wait for RSA_public_decrypt to be resolved and redirected that function's entry to its own code. Public-key authentication therefore ran attacker code before the login decision was made.

Who was responsible?

The commits were made by an account using the name Jia Tan, handle JiaT75, which had become a co-maintainer of xz. No government or group has been formally attributed by any authority, and the real identity behind the account is not publicly established.

What should organizations do about this class of risk?

Know what you depend on, build from version control rather than from pre-generated tarballs where you can, prefer stable distribution packages for infrastructure, and reduce the number of libraries loaded into security-critical processes. None of these would have been guaranteed to catch this one, and all of them narrow the window.

Sources

  1. backdoor in upstream xz/liblzma leading to ssh server compromise, oss-security mailing list (Openwall)
  2. CVE-2024-3094, CVE Program
  3. CVE-2024-3094 Detail, US National Vulnerability Database
  4. Reported Supply Chain Compromise Affecting XZ Utils Data Compression Library, CVE-2024-3094, US Cybersecurity and Infrastructure Security Agency
  5. CVE-2024-3094, Red Hat Customer Portal
  6. CVE-2024-3094 in the Debian Security Tracker, Debian Security Team
  7. Timeline of the xz open source attack, Russ Cox, research!rsc
  8. The xz attack shell script, Russ Cox, research!rsc
  9. SP 800-218, Secure Software Development Framework (SSDF) Version 1.1, US National Institute of Standards and Technology
  10. Supply chain security guidance, UK National Cyber Security Centre
Share this article
LinkedIn WhatsApp X
For organizations

Your people get these messages at work too.

CyberWatch AI sends your staff realistic practice attacks, trains the gaps it finds, and shows management exactly where the organization stands.