Untrusted search path in nix - CVE-2024-38531
Published: July 16, 2025
Vulnerability identifier: #VU113004
CSH Severity: Medium
CVSS v4: 8.5 [CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2024-38531
CWE-ID: CWE-426
Exploitation vector: Local access
Exploit availability:
No public exploit available
Vulnerability details
The vulnerability allows a local user to escalate privileges on the system.
The vulnerability exists due to usage of an untrusted search path during the build process. A local user can place a malicious setuid binary into a globally accessible location and assume the permissions of a Nix daemon worker and hijack all future builds.
Affected software
nix
Ubuntu
nix (Ubuntu package)
Ubuntu
nix (Ubuntu package)
How to mitigate CVE-2024-38531
Install updates from vendor's website.
nix - addressed in versions 2.18.4, 2.19.5, 2.20.7, 2.21.3, 2.22.2, 2.23.1
nix (Ubuntu package) - addressed in versions 2.6.0+dfsg-3ubuntu0.1~esm1, 2.18.1+dfsg-1ubuntu5+esm2
nix (Ubuntu package) - addressed in versions 2.6.0+dfsg-3ubuntu0.1~esm1, 2.18.1+dfsg-1ubuntu5+esm2