Skip to content
RCE Write-up Advanced

The Xz Backdoor Cve 2024 3094 How A Supply Chain Attack Nearly Compromised Every Linux Server

A backdoor was inserted into the XZ Utils compression library, specifically in release tarballs for versions 5.6.0 and 5.6.1, by a contributor who gained maintainer trust over two years. The backdoor hooked OpenSSH's RSA_public_decrypt function to allow remote code execution before authentication, but was discovered due to a 500ms delay in SSH logins.

Sohan Kanna Follow

Published on systemweakness.com

A breakdown of CVE-2024–3094, how the attacker hijacked liblzma, and why this almost became the biggest supply chain compromise in Linux history.

Sohan Kanna, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the attacker exploited the trust in the open-source release process by gaining maintainer access and injecting malicious code into release tarballs, which were not fully reflected in the public Git repository.

Impact

The backdoor could have allowed remote code execution before authentication on affected systems, but it was limited to pre-release distributions and was discovered before stable releases integrated the vulnerable versions.

What the attacker needed

System running vulnerable XZ 5.6.0 or 5.6.1; SSH service using liblzma; attacker possesses crafted certificate

How it was found

  1. The attacker spent about two years contributing small bug fixes to build credibility and gain commit access.
  2. The attacker became release manager and inserted a malicious build-to-host.m4 script into release tarballs for versions 5.6.0 and 5.6.1.
  3. During the configure phase, the script decoded hidden data and injected a malicious object file into liblzma.
  4. The malicious object replaced IFUNC resolvers to install an audit hook into the dynamic linker.
  5. The hook intercepted the OpenSSH symbol RSA_public_decrypt and redirected it to malicious code.
  6. When SSH performed public key authentication, the backdoor checked for a specially crafted certificate and executed system() with attacker-controlled commands.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A backdoor is a secret way to bypass normal security checks. Here, someone spent years becoming a trusted maintainer of a widely used compression tool, then secretly added malicious code to the official release files. This code would let an attacker run commands on many Linux servers without needing a password, but it was caught because a developer noticed SSH logins were slightly slower.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Sohan Kanna

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.