CVE-2026-39860: Nix sandbox escape: file write via symlink at FOD `.tmp` copy destination
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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.34.5 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.33.4 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.32.7 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.31.4 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.30.4 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.29.3 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.28.6
Event History
Frequently Asked Questions
What is the severity of CVE-2026-39860?
CVE-2026-39860 is considered a high-severity vulnerability due to its potential for arbitrary file overwriting.
How do I fix CVE-2026-39860?
To fix CVE-2026-39860, update to versions of Nix higher than 2.34.5, 2.33.4, and so on as listed in the affected software.
Which versions of Nix are affected by CVE-2026-39860?
CVE-2026-39860 affects Nix versions prior to 2.34.5, including 2.33.4, 2.32.7, 2.31.4, and others specified in the advisory.
What is the impact of CVE-2026-39860?
The impact of CVE-2026-39860 includes the possibility of unauthorized file modifications through a symlink attack.
Is it safe to use versions of Nix before the patch for CVE-2026-39860?
No, using versions of Nix before the patch for CVE-2026-39860 is unsafe as they are vulnerable to file overwrite attacks.