CVE-2024-38531 Nix sandbox escape

Low 3.6 Published Updated

A local attacker can create a setuid binary to hijack Nix daemon permissions and execute arbitrary code during future builds.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-38531?

CVE-2024-38531 is a low-severity vulnerability in NixOS nix, published on 28 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

Nix is a package manager for Linux and other Unix systems that makes package management reliable and reproducible. A build process has access to and can change the permissions of the build directory. After creating a setuid binary in a globally accessible location, a malicious local user can assume the permissions of a Nix daemon worker and hijack all future builds. This issue was patched in version(s) 2.23.1, 2.22.2, 2.21.3, 2.20.7, 2.19.5 and 2.18.4.

Weakness: CWE-278

Which versions are affected by CVE-2024-38531?

How do I fix CVE-2024-38531?

Upgrade to a fixed version.

Is CVE-2024-38531 being exploited?

There is no known exploitation of CVE-2024-38531 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-38531, GHSA-q82p-44mg-mgh5, UBUNTU-CVE-2024-38531.

Is CVE-2024-38531 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free