# Security Advisory: Privilege Escalations in Nix, Lix and Guix

**URL:** https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017
**Category:** Security
**Created:** [June 24, 2025, 2:55pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017 "2025-06-24T14:55:59Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tgerbet](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/tgerbet/32/12901_2.png) [@tgerbet](https://discourse.nixosstag.fcio.net/u/tgerbet)
#### Post date: [June 24, 2025, 2:55pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/1 "2025-06-24T14:55:59Z")

</div>

## Summary

This advisory follows up on [the pre-announcement made last week](https://discourse.nixosstag.fcio.net/t/pre-disclosure-announcement-security-advisory-for-nix-and-lix-on-june-24-2025/65831).

Nix and Lix are affected by a set of issues that can be combined to achieve root privilege escalation. These issues are identified as:

- [CVE-2025-46415](https://www.cve.org/CVERecord?id=CVE-2025-46415)
- [CVE-2025-52991](https://www.cve.org/CVERecord?id=CVE-2025-52991)
- [CVE-2025-52992](https://www.cve.org/CVERecord?id=CVE-2025-52992)
- [CVE-2025-52993](https://www.cve.org/CVERecord?id=CVE-2025-52993)

Additionally, a privilege escalation to the build users (`nixbld*`) has been identified. This issue is known as [CVE-2025-46416](https://www.cve.org/CVERecord?id=CVE-2025-46416). This issue is only mitigated by [Lix when the Pasta or LSM mitigations are enabled](https://lix.systems/blog/2025-06-24-lix-cves/#what-to-expect).

This is a coordinated disclosure between the Nix, Lix, and Guix projects. Guix is impacted by similar vulnerabilities.

## Am I affected?

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.

## Patches

The following versions contain the fixes. Versions older than the listed ones must be considered impacted:

- Nix
  - Affected versions: \<= 2.24.14, \<= 2.26.3, \<= 2.28.3, \<= 2.29.0
  - Fixed versions: 2.24.15, 2.26.4, 2.28.4, 2.29.1 (Nix team: CVE-2025-46416’s known vectors mitigated, abstract socket still a weak link for now)

- Lix
  - Affected versions: \<= 2.91.1, \<= 2.92.1, \<= 2.93.0
  - Fixed versions: 2.91.2, 2.92.2, 2.93.1 (CVE-2025-46416 is fixed when the Pasta or LSM mitigations are enabled, [fix for CVE-2025-52992 has been reverted due to a correctness bug](https://lix.systems/blog/2025-06-27-lix-critical-bug/))

- Guix
  - Affected versions: \<= 1.4.0-37.096dedd
  - Fixed versions: 1.4.0-38.0e79d5b

The issues have been fixed in the following nixpkgs PRs:

- NixOS unstable:
  - Nix: [nix: security updates for 2.24, 2.26, 2.28 and 2.29 by Mic92 · Pull Request #419575 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419575) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419575))
  - Lix: [lixPackageSets.\*: fix CVE-46415 and CVE-46416 by RaitoBezarius · Pull Request #419582 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419582) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419582))
  - Lix with Pasta mitigations: [lixPackageSets.\*.lix: use pasta for FODs on supported platforms by alois31 · Pull Request #419638 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419638) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419638))
  - Guix: [guix: 1.4.0 -\> 1.4.0-unstable-2025-06.24 by Mic92 · Pull Request #419555 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419555) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419555))

- NixOS 25.05:
  - Nix: [nix: security updates for 2.24, 2.26, 2.28 and 2.29 [25.05] by Mic92 · Pull Request #419591 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419591) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419591))
  - Lix: [[25.05] lixPackageSets.\*: fix for CVE-2025-46415 and CVE-2025-46416 by RaitoBezarius · Pull Request #419583 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419583) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419583))
  - Guix: [[25.05] guix: 1.4.0 -\> 1.4.0-unstable-2025-06.24 by LeSuisse · Pull Request #419848 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419848) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419848))

- NixOS 24.11:
  - Nix: [nix: security updates for 2.24, 2.28 [24.11] by Mic92 · Pull Request #419590 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419590) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419590)) + [nix: 2.26.3 -\> 2.26.4 [release-24.11] by Mic92 · Pull Request #420130 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/420130) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=420130))
  - Lix: [[24.11] lixVersions.\*: fixes for CVE-2025-46415 and CVE-2025-46416 by RaitoBezarius · Pull Request #419585 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419585) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419585))
  - Guix: [[24.11] guix: 1.4.0 -\> 1.4.0-unstable-2025-06.24 by LeSuisse · Pull Request #419849 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/419849) ([PR progress tracker](https://nixpk.gs/pr-tracker.html?pr=419849))

## Acknowledgement

We would like to thank Rory McNamara from the Snyk Security Labs team for reporting these issues with a great level of detail and for providing feedback.

## References

- [Fixes for five Lix CVEs](https://lix.systems/blog/2025-06-24-lix-cves/)
- [Guix Privilege Escalation Vulnerabilities](https://guix.gnu.org/en/blog/2025/privilege-escalation-vulnerabilities-2025/)
- [NixOS: Declarative Management, Imperative Privilege Escalation - Deep Dive with Snyk Labs](https://labs.snyk.io/resources/nixos-deep-dive/)

---

<div class="post-metadata">

### Author: ![hexa](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/hexa/32/1300_2.png) [@hexa](https://discourse.nixosstag.fcio.net/u/hexa)
#### Post date: [June 24, 2025, 2:57pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/4 "2025-06-24T14:57:03Z")

</div>



---

<div class="post-metadata">

### Author: ![wolfgangwalther](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/wolfgangwalther/32/29720_2.png) [@wolfgangwalther](https://discourse.nixosstag.fcio.net/u/wolfgangwalther)
#### Post date: [June 24, 2025, 3:12pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/5 "2025-06-24T15:12:25Z")

</div>

Do those CVEs also apply to Nix 2.3 and if yes, should this trigger a discussion around the minimum Nix version supported and/or shipped by Nixpkgs?

`nixVersions.nix_2_3` is still available and `lib/minver.nix` is at 2.3.17.

The same applies to `lixPackageSets.lix_2_90.lix`, I guess.

---

<div class="post-metadata">

### Author: ![RaitoBezarius](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/raitobezarius/32/1835_2.png) [@RaitoBezarius](https://discourse.nixosstag.fcio.net/u/RaitoBezarius)
#### Post date: [June 24, 2025, 3:14pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/6 "2025-06-24T15:14:52Z")

</div>

> [@wolfgangwalther](#):
>
> The same applies to `lixPackageSets.lix_2_90.lix`, I guess.

Speaking for the Lix team, Lix 2.90 is vulnerable, it will be removed of unstable.  
Lix 2.91 will be deprecated too as part of this unstable run and removed probably later.  
25.05 will be the last stable version to have 2.90 & 2.91.

≥ 2.92 will be only supported from now on.

We are not affected by the `minVer` discussion because Lix is closer to Nix 2.3 (forked after Nix 2.18 for reminders) than any C++ Nix versions in general.

cc @emily who probably have opinions on this topic.

---

<div class="post-metadata">

### Author: ![llakala](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/llakala/32/27149_2.png) [@llakala](https://discourse.nixosstag.fcio.net/u/llakala)
#### Post date: [June 24, 2025, 4:12pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/7 "2025-06-24T16:12:10Z")

</div>

For high-profile security issues like this, is it possible to cherry-pick a fix into `nixos-unstable` and `nixos-25.05`? Having to wait for Hydra to finish all the other builds leads to a period where the exploit is known, yet a fix isn’t accessible through the proper channels.

The packages wouldn’t be cached if they were simply cherry-picked, which would require users to build the packages locally - however, telling Hydra to “rush a build” would solve this. I’m not familiar with the internal mechanism of Hydra - but this seems like something that should be possible.

---

<div class="post-metadata">

### Author: ![domenkozar](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/domenkozar/32/93_2.png) [@domenkozar](https://discourse.nixosstag.fcio.net/u/domenkozar)
#### Post date: [June 24, 2025, 4:19pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/8 "2025-06-24T16:19:53Z")

</div>

We’ve released [install-nix-action v31.4.1](https://github.com/cachix/install-nix-action/releases/tag/v31.4.1) with the latest Nix containing security fixes.

---

<div class="post-metadata">

### Author: ![RaitoBezarius](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/raitobezarius/32/1835_2.png) [@RaitoBezarius](https://discourse.nixosstag.fcio.net/u/RaitoBezarius)
#### Post date: [June 24, 2025, 4:40pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/9 "2025-06-24T16:40:47Z")

</div>

> [@llakala](#):
>
> For high-profile security issues like this, is it possible to cherry-pick a fix into `nixos-unstable` and `nixos-25.05`? Having to wait for Hydra to finish all the other builds leads to a period where the exploit is known, yet a fix isn’t accessible through the proper channels.

As the Lix blog post recommends it, if you are concerned by getting this ASAP, it’s better to bite the bullet and rebuild it yourself. Lix, for example, is very fast to rebuild.

> [@llakala](#):
>
> The packages wouldn’t be cached if they were simply cherry-picked, which would require users to build the packages locally - however, telling Hydra to “rush a build” would solve this. I’m not familiar with the internal mechanism of Hydra - but this seems like something that should be possible.

Channels were rushed out so it’s OK.

---

<div class="post-metadata">

### Author: ![mkenigs](https://discourse.nixosstag.fcio.net/letter_avatar_proxy/v4/letter/m/51bf81/32.png) [@mkenigs](https://discourse.nixosstag.fcio.net/u/mkenigs)
#### Post date: [June 24, 2025, 5:09pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/10 "2025-06-24T17:09:35Z")

</div>

I’m looking at upgrading from Nix 2.28.2, and it looks like 2.28.4 may have the fix but 2.28.3 does not, as it’s present in nixpkgs from a month ago. The post says 2.28.3 is one of the Fixed versions - is that wrong, or am I misunderstanding something?

---

<div class="post-metadata">

### Author: ![mkenigs](https://discourse.nixosstag.fcio.net/letter_avatar_proxy/v4/letter/m/51bf81/32.png) [@mkenigs](https://discourse.nixosstag.fcio.net/u/mkenigs)
#### Post date: [June 24, 2025, 5:21pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/11 "2025-06-24T17:21:18Z")

</div>

Oh I see, some versions of 2.28.3 have the fix and some don’t, since 2.28.3 has the patch applied in nixpkgs

---

<div class="post-metadata">

### Author: ![NobbZ](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/nobbz/32/7022_2.png) [@NobbZ](https://discourse.nixosstag.fcio.net/u/NobbZ)
#### Post date: [June 24, 2025, 5:23pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/12 "2025-06-24T17:23:20Z")

</div>

> [@tgerbet](#):
>
> Nix
> 
> - Affected versions: \<= 2.24.14, \<= 2.26.3, \<= 2.28.2, \<= 2.29.0
> - Fixed versions: 2.24.15, 2.26.4, 2.28.3, 2.29.1 (no fix for CVE-2025-46416 for now)

Which PR fixed it, from when on will nightly nix have the fix?

---

<div class="post-metadata">

### Author: ![tgerbet](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/tgerbet/32/12901_2.png) [@tgerbet](https://discourse.nixosstag.fcio.net/u/tgerbet)
#### Post date: [June 24, 2025, 5:30pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/13 "2025-06-24T17:30:54Z")

</div>

Sorry about that, I updated the post.

The versions in nixpkgs received the patches directly.

---

<div class="post-metadata">

### Author: ![tgerbet](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/tgerbet/32/12901_2.png) [@tgerbet](https://discourse.nixosstag.fcio.net/u/tgerbet)
#### Post date: [June 24, 2025, 5:45pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/14 "2025-06-24T17:45:24Z")

</div>

For reference, the Guix team also published an announcement blog post: [Privilege Escalation Vulnerabilities (CVE-2025-46415, CVE-2025-46416) — 2025 — Blog — GNU&nbsp;Guix](https://guix.gnu.org/en/blog/2025/privilege-escalation-vulnerabilities-2025/)

---

<div class="post-metadata">

### Author: ![srd424](https://discourse.nixosstag.fcio.net/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@srd424](https://discourse.nixosstag.fcio.net/u/srd424)
#### Post date: [June 24, 2025, 7:45pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/15 "2025-06-24T19:45:31Z")

</div>

For anyone waiting impatiently for the rebuilds, nixos-{24.11,25.05}-small seem to have finished for both nix and lix according to the PR tracker.

---

<div class="post-metadata">

### Author: ![nh2](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/nh2/32/631_2.png) [@nh2](https://discourse.nixosstag.fcio.net/u/nh2)
#### Post date: [June 24, 2025, 10:31pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/16 "2025-06-24T22:31:52Z")

</div>

Just to understand: Because any user on a system can invoke `nix-build` (including various machine users such as `nginx` or `postgres` or whatever, assuming they are not further locked down with e.g. systemd’s hardening functionality), on arbitrary derivations:

- This means escalate to `root` for any UNIX user on the system?

---

<div class="post-metadata">

### Author: ![RaitoBezarius](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/raitobezarius/32/1835_2.png) [@RaitoBezarius](https://discourse.nixosstag.fcio.net/u/RaitoBezarius)
#### Post date: [June 24, 2025, 10:35pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/17 "2025-06-24T22:35:24Z")

</div>

This is a correct assessment.

---

<div class="post-metadata">

### Author: ![nh2](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/nh2/32/631_2.png) [@nh2](https://discourse.nixosstag.fcio.net/u/nh2)
#### Post date: [June 24, 2025, 10:38pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/18 "2025-06-24T22:38:29Z")

</div>

Is there a nice-and-easy mitigation by somehow defining that just specific users can invoke nix-build (e.g. only `root`, other named users known to be humans, and, say, my `jenkins`)?

Because most non-human users on my system have no business invoking `nix-build` in the first place.

---

<div class="post-metadata">

### Author: ![RaitoBezarius](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/raitobezarius/32/1835_2.png) [@RaitoBezarius](https://discourse.nixosstag.fcio.net/u/RaitoBezarius)
#### Post date: [June 24, 2025, 10:39pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/19 "2025-06-24T22:39:02Z")

</div>

> [@nh2](#):
>
> Is there a nice-and-easy mitigation by somehow defining that just specific users can invoke nix-build (e.g. only `root`, other named users known to be humans, and, say, my `jenkins`)?

`allowed-users`, `trusted-users` are two knobs for this.

Making the Nix daemon not have root is also another option.

---

<div class="post-metadata">

### Author: ![nh2](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/nh2/32/631_2.png) [@nh2](https://discourse.nixosstag.fcio.net/u/nh2)
#### Post date: [June 24, 2025, 10:44pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/20 "2025-06-24T22:44:33Z")

</div>

Thank you! It might be worth mentioning `allowed-users` as a mitigation in the main announcement because people can put immediately in place temporarily without having to wait for rebuilds etc.

---

<div class="post-metadata">

### Author: ![RaitoBezarius](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/raitobezarius/32/1835_2.png) [@RaitoBezarius](https://discourse.nixosstag.fcio.net/u/RaitoBezarius)
#### Post date: [June 24, 2025, 10:49pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/21 "2025-06-24T22:49:09Z")

</div>

That’s a good point, my gut feeling is that this is a dangerous workaround / mitigation, I do not expect most users to recover from a mistake configuration on this side because this involves more arcane knowledge (`NIX_REMOTE`, using direct access to store, etc.) in case of failures.

We (on the Lix side) definitely planned on very fast paced updates on all relevant channels and we tested quite the QA so we believe this is the safest option. More advanced users can probably do what you are saying but not super comfy offering this workaround because I don’t know what to tell people: `allowed-users = root raito` ? It all depends on the workload, it feels like… So it’s a bit of “know your workload” situation.

EDIT: a rightful argument by pennae (Lix core team) is that `allowed-users` does not address the fact that untrusted derivations are built all the time including on non-interactive systems due to the scale of things, so this doesn’t protect you _much more_ if you are very exposed. YMMV.

---

<div class="post-metadata">

### Author: ![vcunat](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/vcunat/32/11_2.png) [@vcunat](https://discourse.nixosstag.fcio.net/u/vcunat)
#### Post date: [June 24, 2025, 10:50pm UTC](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017/22 "2025-06-24T22:50:43Z")

</div>

> [@nh2](#):
>
> because people can put immediately in place temporarily without having to wait for rebuilds etc.

Well, Nix itself is cheap to rebuild, and the default versions are in [cache.nixos.org](http://cache.nixos.org) for hours, I believe. (from the -small channels)

[Next page](https://discourse.nixosstag.fcio.net/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017.md?page=2)
