{"id":"CVE-2026-64846","aliases":["DEBIAN-CVE-2026-64846","EUVD-2026-63424","GHSA-6h4g-g5j9-fm5f","UBUNTU-CVE-2026-64846"],"status":"published","title":"Nix: Arbitrary file truncation outside the sandbox with recursive-nix experimental feature","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","severity":{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00108,"percentile":0.01194,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-367","CWE-61"],"published":"2026-08-20T16:18:06Z","modified":"2026-11-02T17:02:09Z","fixes":[{"ecosystem":"Debian:14","package":"nix","fixed_in":["2.35.4+dfsg-1"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:12","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.16.1+dfsg-1","2.16.1+dfsg-2","2.16.1+dfsg-3","2.17.1+dfsg-1","2.18.1+dfsg-1","2.22.1+dfsg-1","2.23.3+dfsg-1","2.23.3+dfsg-2","2.24.12+dfsg-1","2.24.8+dfsg-1","2.24.9+dfsg-1","2.24.9+dfsg-2","2.25.4+dfsg-1","2.26.3+dfsg-1","2.32.5+dfsg-1","2.32.5+dfsg-2","2.34.3+dfsg-1","2.34.6+dfsg-1","2.34.8+dfsg-1","2.35.4+dfsg-1","2.8.0-1.1"]},{"source":"osv","ecosystem":"Debian:13","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.26.3+dfsg-1","2.32.5+dfsg-1","2.32.5+dfsg-2","2.34.3+dfsg-1","2.34.6+dfsg-1","2.34.8+dfsg-1","2.35.4+dfsg-1"]},{"source":"osv","ecosystem":"Debian:14","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.35.4+dfsg-1"}]}],"versions":["2.26.3+dfsg-1","2.32.5+dfsg-1","2.32.5+dfsg-2","2.34.3+dfsg-1","2.34.6+dfsg-1","2.34.8+dfsg-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.10+dfsg1-1","2.3.10+dfsg1-1build1","2.6.0+dfsg-2","2.6.0+dfsg-3","2.6.0+dfsg-3ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.16.1+dfsg-3ubuntu1","2.18.1+dfsg-1ubuntu1","2.18.1+dfsg-1ubuntu2","2.18.1+dfsg-1ubuntu4","2.18.1+dfsg-1ubuntu5","2.18.1+dfsg-1ubuntu5+esm2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.34.3+dfsg-1","2.34.6+dfsg-1","2.34.6+dfsg-1build1","2.34.8+dfsg-1","2.34.8+dfsg-1build1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"nix","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.26.3+dfsg-1ubuntu4","2.26.3+dfsg-1ubuntu5","2.32.5+dfsg-1ubuntu3","2.32.5+dfsg-2ubuntu1","2.34.3+dfsg-1"]}],"products":[{"vendor":"nixos","product":"nix"}],"references":[{"url":"https://github.com/NixOS/nix/security/advisories/GHSA-6h4g-g5j9-fm5f","tags":["x_refsource_CONFIRM","advisory"]},{"url":"https://github.com/NixOS/nix/pull/15401","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/NixOS/nix/commit/26679828f74ee6e82a4100904e6361f993ff5390","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64846.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64846","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-64846","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-64846","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-64846","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-64846","title":"Nix: Arbitrary file truncation outside the sandbox with recursive-nix experimental feature","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","status":"published","published":"2026-08-20T16:18:06.729Z","modified":"2026-08-20T19:32:22.878Z","cvss":[{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-61","CWE-367"],"updated_at":"2026-11-02T14:19:58.214427Z"}],"euvd":[{"id":"EUVD-2026-63424","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","status":"published","published":"2026-08-20T16:18:06Z","modified":"2026-08-20T19:32:22Z","cvss":[{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T18:01:38.846525Z"}],"nvd":[{"id":"CVE-2026-64846","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","status":"published","published":"2026-08-20T17:19:16.813Z","modified":"2026-10-18T20:10:00.11Z","cvss":[{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low","assessor":"secondary"}],"cwes":["CWE-61","CWE-367"],"updated_at":"2026-11-02T14:12:40.302911Z"}],"osv":[{"id":"CVE-2026-64846","title":"Nix: Arbitrary file truncation outside the sandbox with recursive-nix experimental feature","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","status":"published","published":"2026-08-20T16:18:06.729Z","modified":"2026-10-28T11:17:10.818467108Z","cvss":[{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-367","CWE-61"],"updated_at":"2026-11-02T15:45:14.096824Z"},{"id":"DEBIAN-CVE-2026-64846","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","status":"published","published":"2026-08-20T17:19:16.813Z","modified":"2026-11-02T17:02:09.388823577Z","cvss":[{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T17:22:49.730223Z"},{"id":"UBUNTU-CVE-2026-64846","description":"Nix is a package manager for Linux and other Unix systems. Prior to 2.35.0, a malicious derivation executed with the recursive-nix experimental feature can exploit a time-of-check/time-of-use race involving final symlink handling in the LocalStore restore path. The race can cause writeFile to follow a substituted final symlink when opening a path with O_TRUNC instead of enforcing FinalSymlink::DontFollow, allowing the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox with the daemon user's permissions. The primitive does not provide arbitrary-content writes and requires winning the race. This issue is fixed in version 2.35.0.","status":"published","published":"2026-08-20T17:19:00Z","modified":"2026-10-17T13:00:33.970395948Z","cvss":[{"version":"3.1","score":2.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T16:56:53.710209Z"}]}}
