In early 2024, Andres Freund noticed that failed Secure Shell (SSH) logins on his Debian machines were using more processor (CPU) time than they should — and the trail led him to a backdoor hidden in xz Utils, a widely used open-source compression package.
Freund, a PostgreSQL database developer at Microsoft, had been micro-benchmarking and, as he later wrote, “needed to quiesce the system to reduce noise.” On the quieted machine, something stood out: processes of sshd — the program that answers SSH logins — were “using a surprising amount of CPU, despite immediately failing because of wrong usernames etc.”
He profiled sshd. Much of that CPU time went into liblzma, the compression library inside the xz package, and the profiler could not tie it to any named function. He got suspicious. He also remembered “an odd valgrind complaint” in automated tests of PostgreSQL a few weeks earlier. Valgrind is a tool that catches memory errors in running programs.
A login attempt for a user that does not exist should be rejected almost at once. In his test, such an attempt took 0.299 seconds without the backdoored library and 0.807 seconds with it, about half a second longer.
On March 28, thinking at first that only Debian’s package was compromised, he warned Debian, then a private list where Linux distributions coordinate security fixes. The next day he wrote on the public oss-security mailing list: “The upstream xz repository and the xz tarballs have been backdoored.”
Behind that sentence was an operation that had taken more than two years.
Two years of patience
The attacker went by “Jia Tan.” A timeline compiled by the programmer Russ Cox dates Jia Tan’s first, harmless patch to the xz mailing list to October 29, 2021. In April 2022, an account named “Jigar Kumar” began complaining on the list that a patch from Jia Tan was not landing, and in May another, “Dennis Ens,” asked whether part of the project was still maintained. Cox writes that it “seems likely that they were fakes created to push Lasse to give Jia more control.”
Lasse Collin was the maintainer of xz, which he called “an unpaid hobby project.” On June 8, 2022, he replied to the complaints: “I haven’t lost interest but my ability to care has been fairly limited mostly due to longterm mental health issues but also due to some other things.” Three weeks later he wrote that Jia Tan was “practically a co-maintainer already.”
Jia Tan built their first release, version 5.4.2, in March 2023. In January 2024, Jia Tan added the XZ logo to the project’s documentation, with a footer on every page that began “XZ logo © 2023 by Jia Tan.” On February 23, the attacker merged binary test files with the backdoor hidden inside. Version 5.6.0 followed the next day, and 5.6.1 on March 9.
Hidden where reviewers rarely look
The design kept the dangerous parts out of the code that people read. The payload sat inside binary test files, disguised as test data. The step that switched it on, a modified build script called build-to-host.m4, existed only in the release tarballs — the downloadable source archives that Jia Tan prepared — and not in the project’s git repository. When a distribution built its package from such a tarball, the script pulled a prebuilt object out of the test files and altered functions inside liblzma.
OpenSSH, the project that makes sshd, does not use liblzma itself. But Debian and several other distributions patched it to notify systemd, the service manager on many Linux systems. The patch linked in systemd’s library, libsystemd, which at the time depended on liblzma. That chain carried the compromised library into the SSH server. Red Hat summed up the result: the malicious build “interferes with authentication in sshd via systemd.” Analysts who took the code apart reported that the backdoor let whoever held the attacker’s private key run commands on an affected server without logging in.
Caught before the stable releases
The backdoored versions had reached mostly test and rolling releases: Debian’s testing, unstable and experimental distributions, Fedora Rawhide and the Fedora 40 beta, openSUSE Tumbleweed and Kali Linux. Debian said no stable version was known to be affected, and Red Hat said no version of Red Hat Enterprise Linux was affected.
The backdoor was registered in the public catalog of vulnerabilities as CVE-2024-3094, with a severity score of 10.0, the maximum. On March 29, the U.S. Cybersecurity and Infrastructure Security Agency (CISA) advised developers and users to downgrade to an uncompromised version, “such as XZ Utils 5.4.6 Stable.”
Reuters could not establish who was behind Jia Tan. It reported that many people who examined the updates believe the name is a pseudonym for an expert hacker or group, “likely one working on behalf of a powerful intelligence service.”
What the popular retellings get wrong
Retellings often shrink the discovery to one number. A Spanish-language headline on Telefónica’s tech blog called 500 milliseconds of lag the key to discovering the hacker, and Elastic’s security lab titled its analysis “500ms to midnight.” The half second was real; Freund measured it. But in his own account, what started his search was CPU use that stood out on a machine he had quieted for benchmarking; a profile then pointed to liblzma, and he remembered a Valgrind error from a few weeks earlier. It was a chain of small observations, not a slow login that he felt.
Another version credits open source itself. The encrypted-email company Tuta wrote that “Open source makes sure that more eyes are on the code.” Openness did help after the first clue: Freund could compare the release tarball with the public git repository and find the line that existed only in the tarball. Yet the backdoor was not found by someone reading the code. It was found because one engineer noticed what it did at runtime. Freund was blunt: “Really required a lot of coincidences.” In another post, quoted by Reuters, he wrote: “We got unreasonably lucky here.”
What the catch teaches
- Trust is an attack surface. Jia Tan spent more than two years as a helpful contributor before the backdoor went in, and pressure on a maintainer with limited capacity likely helped turn that trust into control.
- Check what you ship, not only what you review. The attack’s trigger lived only in the tarball, in the gap between a repository and its release archive.
- You inherit dependencies you never chose. OpenSSH never asked for liblzma; a distribution patch adding systemd notifications brought it in.
- Quiet systems make anomalies visible. Freund saw the extra CPU because he had removed the noise first.
Freund had quieted his machine to measure something else. In that silence, a login that should have failed in a blink kept the processor busy, and more than two years of patient work came undone. The next time a number in your system is slightly off, ask what the program is doing that nobody asked it to do.
Related stories
Sources
- Andres Freund, “backdoor in upstream xz/liblzma leading to ssh server compromise,” oss-security mailing list, March 29, 2024
- Andres Freund, Mastodon post on how he noticed the backdoor, March 29, 2024
- Russ Cox, “Timeline of the xz open source attack”
- Lasse Collin, “XZ Utils backdoor,” Tukaani project
- XZ Utils git repository: commit adding the XZ logo to the documentation, January 9, 2024
- Red Hat, “Urgent security alert for Fedora Linux 40 and Fedora Rawhide users”
- Debian Security Advisory DSA 5649-1, xz-utils, March 29, 2024
- openSUSE News, “openSUSE addresses supply chain attack against xz compression library,” March 29, 2024
- Kali Linux, “All about the xz-utils backdoor”
- NIST National Vulnerability Database, CVE-2024-3094
- CISA, “Reported Supply Chain Compromise Affecting XZ Utils Data Compression Library, CVE-2024-3094,” March 29, 2024
- Anthony Weems, xzbot: exploration of the xz backdoor
- Raphael Satter (Reuters), “Why Near-Miss Cyberattack Put US Officials and Tech Industry on Edge,” April 8, 2024
- Elastic Security Labs, “500ms to midnight: XZ A.K.A. liblzma backdoor,” April 5, 2024
- Telefónica Think Big, “500 ms de lag: la clave que permitió descubrir a un hacker que llevaba años planeando un ataque en Linux”
- Tuta, “The XZ Backdoor on Linux and the importance of Open Source Software,” April 24, 2024
- PostgreSQL contributors list (Andres Freund, Microsoft)
- Featured image (illustrative): server racks in a data center, not a machine involved in the xz incident. Photograph by Carl Lender, via Wikimedia Commons, CC BY 2.0

Leave a Reply