CVE-2026-64846: Nix: Arbitrary file truncation outside the sandbox with recursive-nix experimental feature

Published Aug 20, 2026
·
Updated

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 OTRUNC 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.

Affected Software

1 affected component
Nix Nix<2.35.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Nix to a version that resolves this vulnerability.

    Fixed in 2.35.0

Event History

Aug 20, 2026
CVE Published
via MITRE·04:18 PM
Data Sourced
via MITRE·04:18 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Nix installations running versions prior to 2.35.0 are exposed when the recursive-nix experimental feature is enabled and a malicious derivation can be executed. The affected operation runs with the permissions of the Nix process or nix-daemon.

2

What does an attacker need to exploit it?

An attacker needs the ability to execute a malicious derivation with recursive-nix enabled and must win a time-of-check/time-of-use race involving final symlink handling. The attack is local and requires low privileges.

3

What is the practical impact if exploitation succeeds?

The attacker can cause the Nix process or nix-daemon to create or truncate an empty file outside the build sandbox, subject to that process's permissions. The issue does not provide arbitrary-content writes.

4

What should be done if patching cannot happen immediately?

Disable the recursive-nix experimental feature and avoid executing untrusted derivations with it enabled. Upgrade to Nix 2.35.0 when possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203