Skip to content
RCE Write-up Advanced

The Backdoor That Was Caught Because Ssh Was A Few Hundred Milliseconds Too Slow

A backdoor was inserted into the xz compression library through a long social engineering campaign, allowing an attacker with a private key to execute code remotely on affected SSH servers. It was discovered because an engineer noticed unusual CPU usage and latency during benchmarking.

Fateyaly Follow

Published on systemweakness.com

Read here.

Fateyaly, 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 open-source maintainers by gradually gaining commit access and then inserting malicious code into release tarballs that was not present in the public repository.

Impact

The backdoor could have allowed pre-authentication remote code execution on affected SSH servers, but it was caught before reaching stable releases of most distributions.

What the attacker needed

Affected xz version 5.6.0 or 5.6.1; sshd linked to liblzma via libsystemd; attacker holds the private key

The fix

The affected versions were patched or downgraded by distributions, and the backdoor was removed.

How it was found

  1. The attacker contributed legitimate patches to xz for years to build a reputation.
  2. Pressure accounts complained about the maintainer's slow pace, leading to the attacker gaining commit access.
  3. The attacker inserted malicious code as binary test files and a build script that only appeared in release tarballs.
  4. The build script extracted the payload during builds on specific Linux distributions.
  5. The payload used IFUNC to replace a function in sshd's memory, gated by a private key.
  6. An engineer noticed SSH slowdowns and traced the issue to the backdoor.

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 access a system that bypasses normal security. Here, someone spent years gaining trust in a volunteer-run software project and then hid malicious code in its release files. This code would let only that person run commands on many Linux servers that use the software, but it was caught before it spread widely.

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 Fateyaly

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.