nix os vulnerable for xz hack?

** NixOS would score meaningfully better than most other major Linux distributions in the context of the XZ backdoor incident (CVE-2024-3094), but not for the reasons people sometimes assume.**

The XZ backdoor (in versions 5.6.0 and 5.6.1) was a sophisticated supply-chain attack where malicious code was hidden in release tarballs (not in the upstream git repo). It only activated during builds that matched certain conditions (mainly distributions that patched OpenSSH to use libsystemd notifications, like Fedora and Debian sid/testing at the time).

Here’s how NixOS compared:

Now, where NixOS arguably scores better overall (especially in hindsight and for future similar incidents):

In contrast, most binary-focused distributions (even those with reproducible builds efforts like Debian) were more directly exposed because:

Bottom line ranking (practical security outcome in this specific incident):

  1. Distributions that never picked up 5.6.x (most stable releases: Ubuntu LTS, RHEL, Debian stable) → best outcome (unaffected).
  2. NixOS, Arch, Gentoo → shipped bad xz but never vulnerable due to OpenSSH differences + (in Nix’s case) build philosophy.
  3. Fedora Rawhide/41, Debian sid, openSUSE Tumbleweed → actually vulnerable for a short window.

So yes — NixOS scores better than most rolling/binary distributions that were vulnerable (Fedora, Debian testing, etc.), and its design gives it structural advantages against similar future tarball-targeted supply-chain attacks. However, it was not immune, and reproducibility alone did not automatically catch this one in 2024 (though it plausibly could have with small process changes).