In 2024, the xz-utils 5.6.0 release tarball shipped with a covertly injected backdoor.
Summary
XZ Utils provides compression tools and the liblzma library. Its 5.6.0 and
5.6.1 release archives contained a backdoor that injected a precompiled object
into liblzma when compiled on selected systems. This account explains the
affected releases and what the backdoored archive does when compiled.
Upstream records date the releases to February 24
and March 9, 2024. Maintainer Lasse Collin confirmed that Jia Tan created and
signed both archives. They contained a modified m4/build-to-host.m4 absent from the
Git repository; the two test files carrying the hidden scripts and object code
were present in Git.
Upstream incident account.
Andres Freund disclosed the backdoor on the oss-security mailing list on
March 29 after investigating unusual processor use and memory-checking errors
during Secure Shell (SSH) logins on Debian unstable. The injection targeted
selected x86-64 Linux targets and checked the compiler, linker and packaging
environment. Some distributions' SSH servers loaded liblzma indirectly through
libsystemd.
Kaspersky's analysis documented how the backdoor intercepted cryptographic
functions such as RSA_public_decrypt on susceptible systems. It accepted
commands signed with the attacker's private key, allowing authentication
bypass or remote command execution.
Where it reached
Affected source releases reached development branches and rolling distributions:
- Fedora Rawhide, then the development branch for Fedora 41, received affected
versions. Fedora 40 beta also contained affected source versions, although
Red Hat said the injection did not appear to take effect in those packages.
Red Hat advisory.
- Debian reported compromised packages in testing, unstable and experimental.
Debian advisory.
- openSUSE Tumbleweed and MicroOS included the affected version between
March 7 and March 28.
openSUSE advisory.
- Kali's March 29 advisory reported that the affected package was available
between March 26 and March 29.
- Ubuntu's affected version remained in
noble-proposed, the testing area
for Ubuntu 24.04, and was removed before entering the release pocket.
Ubuntu advisory.
Debian stable, Red Hat Enterprise Linux and released Ubuntu versions were
unaffected according to their advisories. Canonical recompiled Noble packages
made after February 26 in fresh environments and delayed the Ubuntu 24.04
beta from April 4 to April 11.
Canonical's announcement.
What the backdoored release does
Compiling the 5.6.0 release archive edits liblzma's Makefile, extracts a
precompiled object hidden in one of the release's test files, and links it
into liblzma, so it ends up in liblzma.so.5.6.0 and the xz, xzdec and
lzmainfo tools. Reproducing this shows the tampered compilation, not
exploitation of an SSH server.
References