REDHAT-BUG-2466635: High severity NixOS Nix vulnerability
An issue was discovered in Nix before 2.34.7 and Lix before 2.95.2. Unbounded recursion in the NAR (Nix Archive) parser could lead to a stack-to-heap overflow when the parser is run on a coroutine stack. The stack is allocated without a guard page, which means that a stack overflow could overwrite memory on the heap and could allow arbitrary code execution as the Nix daemon (run as root in multi-user installations) if ASLR hardening is bypassed. This can be exploited by all users able to connect to the daemon (e.g., in Nix, this is configurable via the allowed-users setting, defaulting to all users). The fixed versions are 2.34.7, 2.33.6, 2.32.8, 2.31.5, 2.30.5, 2.29.4, and 2.28.7 for Nix (introduced in 2.24.4); and 2.95.2, 2.94.2, and 2.93.4 for Lix (introduced in 2.93.0).
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.7 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.33.6 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.32.8 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.31.5 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.30.5 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.29.4 - Upgrade
Upgrade
Nixto a version that resolves this vulnerability.Fixed in 2.28.7 - Upgrade
Upgrade
Lixto a version that resolves this vulnerability.Fixed in 2.95.2 - Upgrade
Upgrade
Lixto a version that resolves this vulnerability.Fixed in 2.94.2 - Upgrade
Upgrade
Lixto a version that resolves this vulnerability.Fixed in 2.93.4
Event History
Frequently Asked Questions
Who can exploit this issue in a multi-user deployment?
Any user able to connect to the Nix daemon can exploit it. In Nix, daemon access is controlled by the allowed-users setting, which defaults to all users; successful exploitation could execute code as the root-run daemon if ASLR hardening is bypassed.
Which versions contain fixes?
Nix fixes are available in 2.34.7, 2.33.6, 2.32.8, 2.31.5, 2.30.5, 2.29.4, and 2.28.7. Lix fixes are available in 2.95.2, 2.94.2, and 2.93.4.
What can be done while patching is pending?
Restrict access to the Nix daemon through the allowed-users setting so that untrusted local users cannot connect. This reduces exposure because exploitation requires daemon access.
How can I determine whether a deployment is affected?
Nix is affected beginning with 2.24.4 through releases before the listed fixed versions for each supported branch. Lix is affected beginning with 2.93.0 through releases before 2.95.2, 2.94.2, or 2.93.4, depending on the release branch.