Pre-disclosure announcement: Security Advisory for Nix and Lix on June 24, 2025

Hello everyone,

This post is a pre-disclosure announcement for upcoming security releases of Nix and Lix.
The Snyk Security Labs team has identified and reported the vulnerabilities that will be fixed by these releases.

Disclosure and Release Details

  • Release Date: June 24, 2025 at 14:00 UTC
  • Both Nix and Lix are affected
  • Branch releases that will receive the fixes:
    • Nix: 2.24, 2.26, 2.28 and 2.29
    • Lix: 2.91, 2.92 and 2.93

All systems building untrusted derivations are impacted. Both Linux and Darwin are affected, with Linux systems experiencing a greater impact due to the default-enabled sandbox on them.

Expect full disclosure of the issues after the publication of the patches and releases.

This is a coordinated disclosure between the Nix, Lix and Guix projects. The Guix project also made an announcement: Upcoming security disclosures on June 24, 2025 [guix-devel mail archive].

74 Likes

I appreciate this kind of upfront announcement ! Great job, very professional.

17 Likes

Are there any cautionary measures that should be taken until the releases hit masadoption, which due to the way how nixpkgs work, will very likely not happen before June 27th!

Is the fix already in the nightly builds, or is it held back in secret until release day?

2 Likes

No we do not have the possibility to prefill the caches but it does not imply large rebuilds so the changes will land in the release branches relatively quickly and applying the patches/pulling the new versions with an override in your config is also quite doable.

What is the CVE score?

1 Like

You mean CVSS score?
The CVE number is an identifier.

1 Like

CVSS scores are complex beast and not really meaningful without adjusting to a specific context/threat model. This is not really something that can be provided in a pre-disclosure announcement.

5 Likes

Sad that you didn’t answer the “is there anything we should do now” part of the question…

Most people don’t build untrusted derivations in the first place, so the impact on users who don’t run publicly‐exposed CI/build infrastructure is probably minimal.

(Well, okay: most people don’t ensure that derivations are trustworthy before building them. But they also tend to use the outputs of those derivations in ways that would allow them to be exploited regardless of the Nix sandbox – the Nix sandbox only protects you if you never run code from derivation outputs outside of a sandbox anyway. Maybe just avoid running nixpkgs-review on PRs?)

7 Likes

For your information, I have edited the first post to mention that the Guix project is also part of this coordinated disclosure, as they now have published their pre-announcement :slight_smile:

9 Likes

Thanks! The post became longer as I was reading it :stuck_out_tongue:

1 Like

To clarify for those not familiar with the architecture that many projects use to try to prevent this type of bug from mattering at all by keeping Nix out of the trusted computing base: NixOS/nixpkgs has two CI systems, Hydra, which is trusted and only builds master or branches written by trusted people, and OfBorg, which cannot write to cache.nixos.org and which builds untrusted PRs.

Lix, similarly, only has untrusted CI: our buildkite builds proposed changes and main, but does not write to any publicly accessible cache. Lix binary releases are built on trusted dev machines at the moment and are, to the best of my knowledge, bit-reproducible on Linux.

This is relating to the recommendations of Lix’s multi-user security model docs which I rewrote a few months back to clarify what we consider the intended security model: Multi-User Mode - Lix Reference Manual

19 Likes

The infra team will also make sure that known public CIs that are affected by this, will be patched before the release is happening.

8 Likes

I use NixOS on a personal computer for stuff like replying to e-mails, browsing the web, playing games, and pushing code to remote Git repositories. I’ve modified my configuration.nix, but I don’t know what an “untrusted derivation” is. Will the June 24 disclosure explain, in terms that I can understand, what I need to do to keep my system secure? If not, where can I find out?

@fareycircles Assume the worst - that it’s possible for stuff inside build sandbox to gain full root on host (just my speculation)

Do you expect any package/derivation/flake input that you’re using to be malicious and attempt to abuse such thing? If not then you’re fine, but if you want to be extra cautious then don’t run flake update until the patch is in nixpkgs on the branch that you’re using. (and maybe bump only nixpkgs first, switch to newer nix/lix, then update the rest of stuff)

Another case is when you have for example a shared server where various people which you don’t control are in allowed-users and can build various stuff on their own - consider them untrusted.

TL;DR - you probably don’t need to worry.

1 Like

Thanks for the advice! Let me repeat what I’ve understood of it to see if I’m reading it correctly.

  • :information_source: When I run nixos-rebuild, my system runs code from various sources, which I shouldn’t entirely trust. That code runs inside a “build sandbox” which is supposed to restrict its access to my system, reducing its ability to wreak havoc.
  • :information_source: This vulnerability may weaken the walls of the build sandbox, allowing the code run by nixos-rebuild to access parts of the system that it shouldn’t be allowed to touch.
  • :warning: It’s risky to call nixos-rebuild before the branch of nixpkgs that I’m using is patched, because the code it runs could exploit this vulnerability.
  • :white_check_mark: It’s probably still safe to boot and run the current build of my system.

Is that more or less right?

1 Like

yes, but since no one except from few trusted people knows what this exactly is, someone exploiting this in the wild before reveal is very unlikely, so it should be safe to update inputs and rebuild right now anyway.
you’re also fine to nixos-rebuild with what you currently have since everything is hashed/pinned to commits and won’t somehow magically turn malicious

basically once the vuln is disclosed and patch is merged/out in channels, update only nixpkgs first. Before disclosure you can do pretty much whatever you want

2 Likes