· 7 min read ·

Below the CVE Scanner: How StageX Approaches the Bootstrap Trust Problem

Source: lobsters

The Trust Problem Starts Before Package Signatures

When you pull an Alpine or Ubuntu base image, the security story begins with signatures. The registry returns a manifest with a SHA-256 digest; your container runtime verifies it. The image has not been tampered with in transit. That is a meaningful guarantee, but it is a narrow one. It says nothing about whether the binaries inside the image were built from the source code they claim to be built from, or whether the tools that built those binaries were clean.

StageX is a Linux distribution built on the conviction that this gap matters, and that closing it requires rethinking how distribution build infrastructure is structured from the root up. The core claim is that most Linux distributions, including ones that invest seriously in security, have single points of failure that can compromise all packages built on them without leaving a trace in any signature scheme.

Ken Thompson’s 1984 Problem

The foundational statement of this problem comes from Ken Thompson’s 1984 Turing Award lecture, “Reflections on Trusting Trust.” Thompson described an attack that requires no access to source code. You modify a C compiler to recognize when it is compiling a login program, and insert a backdoor. Then you modify the compiler to recognize when it is compiling a copy of itself, and insert both the login backdoor and the self-replication logic into the output. You then rebuild the compiler from the original clean source. The resulting binary contains the attack. The source does not. Any audit of the source finds nothing wrong.

The attack has no cryptographic fix. It is a consequence of the gap between source and binary, and the fact that your toolchain is itself a binary produced by an earlier toolchain. Trust has to terminate somewhere, and where it terminates is the question.

Most Linux distributions terminate trust in a bootstrap tarball: a collection of pre-compiled binaries compiled at some point in the past by someone with access to the build machines. This is the origin of every downstream binary. The provenance of that tarball, the exact environment and tools used to build it, is generally not reproducible or auditable by outside parties.

What Bootstrappable Builds Actually Means

The Bootstrappable Builds project has been working on a different answer. The goal is to build an entire software stack from a minimal “seed” binary, small enough to be audited by hand or formally verified. From that seed, a chain of stages builds progressively more capable tools, until you arrive at a fully capable build environment.

The GNU Guix distribution has integrated this most completely. Since version 1.1, Guix has maintained a bootstrap seed of roughly 256 bytes, a minimal hex assembler, that can build the rest of the distribution through a staged sequence: the hex assembler builds a slightly more capable assembler, which builds a C compiler, which builds mes (a Scheme interpreter), which builds tinycc, which builds gcc, which builds everything else. Each step in the chain is verifiable in isolation. No pre-compiled GCC anywhere in the lineage.

This is what “bootstrappable” means in practice: the ability to trace every binary in the distribution back to a minimal, auditable root, with no opaque pre-compiled intermediaries. Most distributions, including NixOS despite its strong reproducibility story, have not fully achieved this. NixOS tracks current package reproducibility at r13y.com, which runs above 98% for most releases, but the bootstrap itself still trusts a pre-compiled binary archive that is not derived from a publicly auditable seed chain.

Single Points of Failure in Practice: The XZ Case

The XZ utils backdoor discovered in March 2024 (CVE-2024-3094) is the most instructive recent case study in supply chain attacks. The attacker spent approximately two years contributing to the XZ project under a pseudonym, establishing trust with the original maintainer through legitimate contributions before gradually taking over release responsibilities. The backdoor was introduced in the build system, specifically in the autoconf macros used during compilation, in a form that would not be visible in the normal source files. The resulting liblzma, a library used by systemd and therefore by sshd on many systems, contained code that would allow unauthenticated remote code execution for holders of a specific RSA key.

The attack was caught by chance when a Microsoft engineer noticed unusual CPU usage in an SSH client on a Fedora testing system. If it had shipped in Debian stable, it would have been present in essentially every Debian-derived container base image in production.

The single point of failure was the maintainer: a single human being who could be identified, targeted, and socially engineered over a long time horizon. No package signature would have detected this, because the attacker had signing access. No CVE scanner would have found it, because it was not a known vulnerability. The attack surface was the trust model of the project, not any specific line of code.

StageX’s structural response to this class of attack is to design distribution infrastructure where no single entity, human or machine, can unilaterally introduce a compromise that reaches all users without detection. That requires distributing trust across multiple independent builders and verifiers, which in turn requires reproducible builds. If two independent parties build the same source and get different binaries, something is wrong. If they get the same binary, the probability that both have been compromised in identical ways without the other noticing is negligible.

Reproducibility as the Prerequisite for Distributed Verification

Reproducibility is not primarily about archival or historical auditability. It is the technical prerequisite for having multiple independent parties verify each other’s work. A build process that produces different outputs depending on the build machine, the timestamp embedded in binaries, or the kernel version cannot be externally verified. You can only check your own build against the official claim, not against another independent builder’s result.

StageX distributes its container images as OCI artifacts with content-addressable digests. A SHA-256 digest commits you to a specific bit pattern. If multiple independent parties build from the same source and produce images with the same digest, you have consensus: the build process is deterministic and all builders arrived at the same answer. A compromised builder that produces a different output would be immediately visible as an outlier in any system that collects and compares rebuild results.

This is the mechanism that makes distributed verification meaningful. Without reproducibility, you cannot compare. With it, you can treat the question of whether a binary is trustworthy as a consensus problem among independent parties rather than a matter of trusting a single authority.

How This Compares to Other Container Security Approaches

Chainguard’s Wolfi Linux addresses a different part of the container supply chain security problem. Wolfi focuses on SBOMs (software bills of materials), Sigstore-based image signing with cosign, and continuous CVE scanning for known vulnerabilities. It uses musl libc and the apk package manager to keep the attack surface minimal, and publishes regular distroless images for common language runtimes. These are operationally valuable properties, and Wolfi is well-maintained and used in production at scale.

The two approaches are complementary rather than competing. Wolfi addresses the transparency and attestation layer: you can verify what software is in the image, see its CVE status, and confirm the image was produced by a known build system and has not been tampered with. StageX addresses the build toolchain trust layer underneath: whether the tools that built those packages were themselves trustworthy from a bootstrappable root.

Alpine Linux uses musl and BusyBox, which gives it a smaller attack surface than glibc-based distributions, but it does not attempt to solve the bootstrap trust problem. Google’s Distroless images minimize the runtime attack surface by removing the package manager and shell from the final image, which is useful, but the build infrastructure behind them still relies on a trusted Debian base.

NixOS comes closest among general-purpose distributions to what StageX is doing with reproducibility, and the Nix store’s content-addressed model means that any two systems building the same derivation should, in theory, produce the same hash. In practice, reproducibility coverage is high but not complete, and the bootstrap story is weaker than Guix’s.

The Layer Below the Scanner

There is a recurring pattern in container security discussions where “supply chain security” means running Trivy or Grype against an image and tracking CVE counts. This is not useless. Known vulnerabilities in known packages are real threats, and scanning catches real problems. But it operates entirely within the layer of known software sitting on top of a trusted build infrastructure.

The layer below that, the question of whether the build toolchain itself is trustworthy, whether the bootstrap is auditable, whether the build process is reproducible enough for independent verification, receives much less attention. It is slower work, less immediately visible, and harder to represent on a security dashboard. It is also where the XZ attack happened.

What StageX is doing belongs to a tradition that goes back to Thompson’s lecture and forward through the Bootstrappable Builds project, GNU Guix’s 256-byte seed, and the reproducible builds work across Debian, NixOS, and others. The specific contribution is applying this rigor to the container use case, where base images are a particularly high-leverage attack surface because of how widely they are built upon.

A compromised container base image can affect millions of running workloads before anyone notices. That makes the bootstrap problem not just philosophically interesting but operationally urgent, which is why a distribution built around eliminating the single points in that chain is worth paying attention to.

Was this interesting?