Cybersecurity

Software Supply-Chain Attacks: From Dependencies to Build Systems

The xz Utils backdoor came within weeks of shipping in major Linux distributions after a two-year social engineering campaign against an open-source maintainer. It is the clearest example yet that supply-chain attacks target every link, from dependencies to build systems. Here is a map of those links and the controls for each.

By EthicalHat Research · · 3 min read
Infographic: Every link in the software supply chain is a target

On 29 March, Microsoft engineer Andres Freund noticed that SSH logins on a Debian test system were taking about half a second longer than they should. His investigation uncovered a backdoor in xz Utils versions 5.6.0 and 5.6.1 (CVE-2024-3094). The data-compression library is a dependency of countless Linux systems. On distributions that link OpenSSH to systemd, the malicious code in liblzma could hijack the SSH daemon's authentication and give whoever held a specific key remote access.

It was caught in development and testing versions of Debian, Fedora and others, weeks before reaching most stable releases. Had it not been, it would have been one of the most serious supply-chain compromises ever.

How the xz backdoor was built

What makes xz remarkable is not the code but the patience behind it:

  • A contributor using the name "Jia Tan" began submitting helpful patches in 2021.
  • Around the same time, other accounts pressured the long-time, overstretched maintainer to accept help and hand over responsibility.
  • Over two years, "Jia Tan" became a trusted co-maintainer with release rights.
  • The backdoor was hidden in binary test files and activated by build scripts present only in the release tarballs, not in the Git repository most reviewers read.

In other words, this was a social engineering campaign against an open-source maintainer, and a build-time injection designed to evade code review.

Mapping the supply chain

xz is one example. The last few years have produced attacks against every link:

flowchart TB
  subgraph Source
    S1[Maintainer takeover<br/>xz Utils 2024, event-stream 2018]
  end
  subgraph Dependencies
    D1[Typosquatting & malicious packages]
    D2[Dependency confusion<br/>2021 research, PyTorch torchtriton 2022]
  end
  subgraph Build
    B1[Compromised build system<br/>SolarWinds 2020]
    B2[Tampered CI tooling<br/>Codecov 2021]
  end
  subgraph Distribution
    R1[Trojanised installers<br/>3CX 2023]
  end
  Source --> Dependencies --> Build --> Distribution --> Prod[Your production]
  • Source: a malicious maintainer or a compromised developer account introduces code.
  • Dependencies: attackers publish lookalike packages, or claim internal package names on public registries so builds pull the malicious public version (dependency confusion).
  • Build: the build system itself is compromised, so clean source produces a trojanised artefact. SolarWinds' SUNBURST was injected this way.
  • Distribution: signed installers, update servers or registries deliver the payload. The 3CX desktop app was itself compromised through another supplier's trojanised software.

For dependencies you consume:

  • Pin versions and verify hashes with lock files, so builds do not silently pick up new releases.
  • Use a private proxy or mirror for package registries, and configure scoped namespaces to prevent dependency confusion.
  • Monitor for known-bad releases with software composition analysis and SBOMs, so you can answer "do we ship xz 5.6.x?" in minutes.
  • Evaluate project health before adopting new dependencies. OpenSSF Scorecard checks things like branch protection, code review and maintainer activity.
bash
# Is a vulnerable xz version present on this host or in this image?
xz --version
dpkg -l | grep -E 'xz-utils|liblzma' || rpm -qa | grep -E '^xz'

# Across container images, using an SBOM tool
syft registry.example.com/api:latest -o json | jq -r '.artifacts[] | select(.name|test("xz|liblzma")) | "\(.name) \(.version)"'

For software you build:

  • Harden the pipeline. Protected branches, required reviews, ephemeral build runners, least-privilege CI tokens and no long-lived secrets.
  • Build from source you reviewed. The xz payload lived in the release tarball. Build from the tagged repository, and compare published artefacts against rebuilds where you can.
  • Generate provenance. The SLSA framework, which reached version 1.0 last year, defines levels of build integrity. At minimum, record which source, builder and parameters produced each artefact.
  • Sign what you ship. Sign artefacts and container images (for example with Sigstore) and verify signatures at deployment.

For software you deploy:

  • Verify signatures and provenance in admission control before anything runs.
  • Limit blast radius. Egress filtering, least privilege and runtime detection limit what a backdoored component can do, and are why defence in depth still matters.

The human side

The xz maintainer was a volunteer maintaining critical infrastructure largely alone, and the attack exploited exactly that. Supply-chain security is not only a tooling problem. Organisations that depend on open source can:

  • identify the small, critical projects they rely on,
  • contribute engineering time, funding or maintainers to them, and
  • be cautious about pressure campaigns and sudden changes in who controls a project.

What to do this month

  1. Confirm no systems or images carry xz 5.6.0 or 5.6.1.
  2. Make sure you can list every open-source component in your top applications (an SBOM).
  3. Review your CI system with the same rigour as production: who can change pipelines, and which secrets can builds reach?
  4. Start signing build artefacts and verifying them at deploy time.

Our secure code review and application security testing teams assess build pipelines and dependency management alongside the application code itself.

EthicalHat Research

The EthicalHat research team: penetration testers, SOC analysts and engineers writing about security, software engineering and AI.

Want an expert opinion on your own systems?

Email info@ethicalhat.com or call +1-844-838-4422. Our security engineers are happy to talk it through.