Vulnerabilities

7 min readUpdated

CVE-2024-3094: the XZ Utils backdoor

Quick answer

CVE-2024-3094 is a supply-chain backdoor hidden in the XZ Utils compression library, versions 5.6.0 and 5.6.1. Malicious code disguised as test data was built into liblzma and, on distributions that link sshd to libsystemd, could let an attacker holding a secret key run commands through sshd before login. A contributor identity spent years earning co-maintainer trust before planting it. Andres Freund disclosed it on 29 March 2024, after noticing slow SSH logins. Almost no stable distribution shipped it.

At a glance

critical severity
Identifier
CVE-2024-3094
Also known as
XZ Utils backdoor
Product
XZ Utils / liblzma (upstream release tarballs)
Affected
xz 5.6.0; xz 5.6.1
Fixed in
Downgrade to 5.4.x (CISA recommends 5.4.6); distribution reverts to the 5.4 series; upstream 5.6.2 and later (clean releases from 29 May 2024)
CVSS
10.0 (CVSS 3.1, NVD and Red Hat)
Disclosed
Known exploited (CISA KEV)
Not listed

Caught before wide release. Affected mainly rolling and pre-release distributions; most stable releases were never exposed.

01What is CVE-2024-3094?

CVE-2024-3094 is not an ordinary coding bug. It is a deliberately planted backdoor in XZ Utils, the project behind the xz command and the liblzma compression library used across Linux. The bulk of the malicious code sat in the git repository disguised as binary test files; the trigger that extracted it was a modified build script present only in the release tarballs for versions 5.6.0 and 5.6.1, so building from the git history alone did not produce a backdoored library.

When liblzma was built as a Debian or RPM package on x86-64 with gcc and the GNU linker, the backdoor wove itself into the library. On distributions that patch OpenSSH to support systemd notification, sshd pulls in libsystemd, which depends on liblzma, so the compromised code ended up loaded inside the SSH daemon. There it hooked a cryptographic function so that a client presenting the attacker's secret key could run commands — effectively remote code execution, reachable before login.

02Which distributions shipped it?

The short version: almost no stable release. The backdoor was present in 5.6.0 and 5.6.1, which had mostly reached rolling-release and pre-release channels when it was caught. Stable Debian, released Ubuntu, and Red Hat Enterprise Linux were never affected.

DistributionExposureClean/fixed version
Fedora Rawhide / Fedora 40 (pre-release)Rawhide 5.6.0 or 5.6.1; Fedora 40 possibly 5.6.0Downgrade to 5.4.x builds; RHEL unaffected
Debian testing/unstable5.5.1alpha-0.1 to 5.6.1-15.6.1+really5.4.5-1 (DSA-5649-1)
openSUSE Tumbleweed / MicroOS7–28 March 2024Update to 20240328 or later, reboot
Kali Linux26–29 March 2024 (5.6.0-0.2)Upgrade liblzma5
Arch Linux5.6.0-1 and 5.6.1-1 present5.6.1-2; sshd not linked to liblzma
Debian stable, released Ubuntu, RHELNot affectedNo action for xz itself

03How the backdoor worked, conceptually

During the package build, an obfuscated script extracted machine code from a disguised test file and linked it into liblzma. At process start, before the process's relocation table (GOT) was remapped read-only, the code installed a hook into the dynamic linker and waited for a specific cryptographic routine in sshd to be resolved, then redirected it to attacker-controlled code.

The result was a key-gated remote path: only a client holding the matching private key could trigger it, which is why a passer-by could not simply exploit it. The backdoor also made SSH logins measurably slower — a stray half-second — which is precisely the anomaly that led to its discovery.

04How to check if you are affected

Check the installed liblzma / xz version. If it is in the 5.6.0–5.6.1 range on an affected distribution, treat the host as compromised rather than merely vulnerable, because a backdoor may have been used and a version downgrade alone does not prove the system is clean.

Version checks (validated on Debian 12)
# Debian/Ubuntu/Kali: library and tool versions
apt-cache policy liblzma5          # look for an installed 5.6.0 / 5.6.1
dpkg-query -W -f='${Package} ${Version}\n' liblzma5 xz-utils

# Any distro: does sshd even link liblzma on this box?
ldd "$(command -v sshd)" | grep -E 'liblzma|libsystemd'

# RPM-based systems
rpm -q xz xz-libs
xz --version                       # 5.6.0 or 5.6.1 = backdoored release

05How to remediate

The fix is to get off 5.6.0/5.6.1 and back onto the 5.4 series, which carries none of the malicious content. CISA's advice on 29 March 2024 was to downgrade to an uncompromised version such as XZ Utils 5.4.6 Stable, hunt for malicious activity, and report findings. Debian and openSUSE had already rolled back, and Arch had rebuilt the package from git rather than the tarball, on 28 March; the clean upstream 5.6.2 followed on 29 May 2024.

  • Apply your distribution's xz / liblzma update, which reverts to 5.4.x content
  • Reboot, or at minimum restart sshd and anything else linked to liblzma, so the clean library is actually loaded
  • On any host that ran the backdoored version with SSH exposed, treat it as potentially compromised: rebuild rather than trust it, and rotate keys and credentials
  • Audit container images and CI base images, where old backdoored layers can linger long after the host is fixed

06What a WAF can and cannot do

Nothing at the HTTP edge filters this. The malicious path is in the SSH daemon, keyed to a secret the attacker holds, and it does not traverse a web application firewall or a reverse proxy at all. There is no signature a WAF could match that would help, and any vendor claiming to "block CVE-2024-3094" at the web layer is overstating it.

The honest control set here is supply-chain discipline: pin and verify dependencies, prefer building from reviewed source over opaque release tarballs, watch for behavioural anomalies like the login slowdown that exposed this one, and keep management services such as SSH off the public internet — the same advice that limits regreSSHion — so a key-gated backdoor has no easy route in. Hiding your origin behind a proxy reduces exposure of the box; it does not touch the dependency itself.

07Timeline: a multi-year social-engineering campaign

The attack's real weapon was patience. An identity spent years building credibility before planting the code, exploiting an exhausted volunteer maintainer. CISA's follow-up, "Lessons from XZ Utils" (12 April 2024), argued that every technology manufacturer that profits from open source must be a responsible consumer of, and sustainable contributor to, the packages it depends on, rather than leaving critical libraries to lone volunteers. For defenders, the practical reading is to treat every dependency as a trust decision and to keep the exposed surface small — the same inventory discipline that preparing for a DDoS attack relies on.

DateEvent
29 Oct 2021The "Jia Tan" identity sends its first patch to the xz project
2022Pressure from sock-puppet accounts pushes the burned-out maintainer to add a co-maintainer
28 Oct 2022Jia Tan added to the Tukaani organisation on GitHub
30 Dec 2022Jia Tan merges commits directly, showing commit access
24 Feb 2024xz 5.6.0 released with the backdoored build script
9 Mar 2024xz 5.6.1 released with a refined backdoor
28 Mar 2024Andres Freund privately reports it to Debian and distros@openwall
29 Mar 2024Public disclosure on oss-security; CISA issues its alert
29 May 2024Clean upstream release XZ Utils 5.6.2

Questions

Frequently asked questions

Only if it ran xz/liblzma 5.6.0 or 5.6.1 on an affected distribution, which almost always meant a rolling-release or pre-release system. Stable Debian, released Ubuntu and RHEL were never affected. Check your installed liblzma5 version; if it is in the 5.6.0–5.6.1 range, treat the host as compromised and rebuild it.

OpenSSH does not use liblzma directly. Several distributions patch sshd to support systemd startup notification, which pulls in libsystemd, which depends on liblzma. The backdoored library was therefore loaded inside the SSH daemon's process, where it could hook authentication. Distributions that do not link sshd to liblzma, such as Arch, lacked that path.

Downgrading removes the malicious library, but if the backdoor was reachable and your SSH was exposed, you cannot prove nothing happened. Best practice is to rebuild the host from known-good media and rotate keys and secrets. Also check container images and CI caches, where old backdoored layers can persist long after the host is patched.

No. It was caught before reaching stable distributions widely, and there is no confirmed in-the-wild exploitation at scale, so it is not listed in CISA KEV. That does not lower the severity of the design — it reflects that discovery happened early, largely by luck, thanks to one engineer investigating a performance oddity.

No. The malicious code runs inside sshd and is gated by a secret key the attacker holds; it never passes through an HTTP reverse proxy or WAF. The real defences are supply-chain hygiene, dependency pinning and verification, behavioural monitoring, and keeping SSH off the public internet. No edge signature meaningfully addresses it.

Sources

Sources and verification

Version-inspection commands (apt-cache policy, dpkg-query, ldd, xz --version) run on Debian 12, October 2026; the rpm query is standard syntax but rpm was not available on the test host. No part of the backdoor is reproduced.

  1. 01NVD — CVE-2024-3094 · NVD
  2. 02backdoor in upstream xz/liblzma (original disclosure) · Andres Freund, oss-security
  3. 03XZ Utils backdoor (maintainer's page) · tukaani.org
  4. 04Reported Supply Chain Compromise Affecting XZ Utils (CVE-2024-3094) · CISA
  5. 05DSA-5649-1 xz-utils security update · Debian
  6. 06Urgent security alert for Fedora Linux 40 and Fedora Rawhide users · Red Hat
  7. 07CVE-2024-3094 (Ubuntu) · Canonical
  8. 08xz backdoor timeline · Russ Cox
  9. 09The xz package has been backdoored · Arch Linux
  10. 10openSUSE addresses supply chain attack against xz compression library · openSUSE
  11. 11All about the xz-utils backdoor · Kali Linux
  12. 12Lessons from XZ Utils: Achieving a More Sustainable Open Source Ecosystem · CISA
  13. 13XZ backdoor still lurking in Docker images · BleepingComputer

Last updated