Back

[Analysis]

xz-utils backdoor (CVE-2024-3094): a malicious maintainer in a core Linux library

Two years of patient social engineering put a backdoor into a compression library at the heart of Linux. It was caught by accident, because SSH logins got half a second slower. What it teaches anyone who reviews code or depends on open source.

On 29 March 2024, Andres Freund, a PostgreSQL developer, posted to the oss-security mailing list about something odd. SSH logins on a test machine were using more CPU than they should and taking around half a second longer. He traced the delay to liblzma, part of the xz compression tools that almost every Linux distribution ships. What he’d found was a deliberately planted backdoor in xz versions 5.6.0 and 5.6.1, since tracked as CVE-2024-3094 with the maximum severity score of 10.0.

It had been caught mostly in development and rolling-release distributions, before it reached the stable releases that most servers run. That was luck, not design, and it has become the case study we reach for when people ask what code review is for.

Two years of patience

The code wasn’t the clever part. The trust was.

From 2021, someone using the name “Jia Tan” began contributing useful patches to xz. Through 2022, other accounts, widely believed to be sock puppets, piled pressure on the project’s long-standing, unpaid maintainer, complaining about slow progress and pushing for a new co-maintainer. Jia Tan was that person, and in time was making releases of xz themselves.

The backdoor itself was split so that no single change looked alarming:

[Two years to build trust]

  1. 2021First helpful patches arrive
  2. 2022Sock-puppet accounts press a tired maintainer; "Jia Tan" becomes co-maintainer
  3. Feb 20245.6.0 and 5.6.1 ship a backdoor, hidden in the release tarballs
  4. 29 Mar 2024Slow SSH logins lead to its discovery

CVE-2024-3094, CVSS 10.0

What this means for code review

Most of us will never face an attacker this patient. The lessons still apply to ordinary projects:

Protecting the build, not just the code

The backdoor never appeared in a diff anyone was asked to approve. It went in through the release tarball and the build scripts, and that’s where we’d put the effort first:

None of this is new. Two of the eight principles in the NCSC’s secure development and deployment guidance, protecting the code repository and securing the build and deployment pipeline, cover the same ground. The government’s voluntary Software Security Code of Practice (May 2025) makes build environment security one of its four themes. If you sell software to other organisations, expect them to start asking how you handle it.


Sources

Back