# CVE-2026-39860: Nix sandbox escape: file write via symlink at FOD \`.tmp\` copy destination

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.0
- **CVSS:** 9.0 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **CWE:** CWE-61
- **Published:** 2026-04-08T20:58:22.979Z
- **Modified:** 2026-07-24T21:10:00.143Z

## Who should check

- Anyone running NixOS nix \>= 2.21, \< 2.28.6; \>= 2.29.0, \< 2.29.3; \>= 2.30.0, \< 2.30.4; \>= 2.31.0, \< 2.31.4; \>= 2.32.0, \< 2.32.7; \>= 2.33.0, \< 2.33.4; \>= 2.34.0, \< 2.34.5; \>= 2.20.5, \<= 2.20.9; \>= 2.19.4, \<= 2.19.7; \>= 2.18.2, \<= 2.18.9

## Description

Nix is a package manager for Linux and other Unix systems. A bug in the fix for CVE-2024-27297 allowed for arbitrary overwrites of files writable by the Nix process orchestrating the builds (typically the Nix daemon running as root in multi-user installations) by following symlinks during fixed-output derivation output registration. This affects sandboxed Linux builds - sandboxed macOS builds are unaffected. The location of the temporary output used for the output copy was located inside the build chroot. A symlink, pointing to an arbitrary location in the filesystem, could be created by the derivation builder at that path. During output registration, the Nix process (running in the host mount namespace) would follow that symlink and overwrite the destination with the derivation's output contents. In multi-user installations, this allows all users able to submit builds to the Nix daemon (allowed-users - defaulting to all users) to gain root privileges by modifying sensitive files. This vulnerability is fixed in 2.34.5, 2.33.4, 2.32.7, 2.31.4, 2.30.4, 2.29.3, and 2.28.6.

## Affected and fixed versions

- NixOS nix: \>= 2.21, \< 2.28.6; \>= 2.29.0, \< 2.29.3; \>= 2.30.0, \< 2.30.4; \>= 2.31.0, \< 2.31.4; \>= 2.32.0, \< 2.32.7; \>= 2.33.0, \< 2.33.4; \>= 2.34.0, \< 2.34.5; \>= 2.20.5, \<= 2.20.9; \>= 2.19.4, \<= 2.19.7; \>= 2.18.2, \<= 2.18.9 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-39860. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-39860.md
Affected: NixOS nix >= 2.21, < 2.28.6; >= 2.29.0, < 2.29.3; >= 2.30.0, < 2.30.4; >= 2.31.0, < 2.31.4; >= 2.32.0, < 2.32.7; >= 2.33.0, < 2.33.4; >= 2.34.0, < 2.34.5; >= 2.20.5, <= 2.20.9; >= 2.19.4, <= 2.19.7; >= 2.18.2, <= 2.18.9
Fixed in: NixOS nix 2.28.6, NixOS nix 2.29.3, NixOS nix 2.30.4, NixOS nix 2.31.4, NixOS nix 2.32.7, NixOS nix 2.33.4, NixOS nix 2.34.5

Steps:
1. Search this machine and project for NixOS nix: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-39860 being exploited?

There is no confirmed exploitation: CVE-2026-39860 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-39860?

Critical: CVSS 9.0 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-39860?

NixOS nix \>= 2.21, \< 2.28.6; \>= 2.29.0, \< 2.29.3; \>= 2.30.0, \< 2.30.4; \>= 2.31.0, \< 2.31.4; \>= 2.32.0, \< 2.32.7; \>= 2.33.0, \< 2.33.4; \>= 2.34.0, \< 2.34.5; \>= 2.20.5, \<= 2.20.9; \>= 2.19.4, \<= 2.19.7; \>= 2.18.2, \<= 2.18.9.

### Is there a fix for CVE-2026-39860?

Yes. Fixed in NixOS nix 2.28.6, NixOS nix 2.29.3, NixOS nix 2.30.4, NixOS nix 2.31.4, NixOS nix 2.32.7, NixOS nix 2.33.4, NixOS nix 2.34.5. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-39860?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/NixOS/nix/security/advisories/GHSA-g3g9-5vj6-r3gj>
- patch: <https://github.com/NixOS/nix/pull/10178>
- patch: <https://github.com/NixOS/nix/commit/244f3eee0bbc7f11e9b383a15ed7368e2c4becc9>
- patch: <https://github.com/NixOS/nix/commit/4bc5a3510fa3735798f9ed3a2a30a3ea7b32343a>
- patch: <https://github.com/NixOS/nix/commit/7794354a982449927ee7401cdeb573ddd16c4688>
- patch: <https://github.com/NixOS/nix/commit/a3163b9eabb952b4aa96e376dea95ebcca97b31a>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-39860>

HTML: <https://flawdb.com/CVE-2026-39860> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-39860>
