Description
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);
Published: 2026-05-05
Score: 5.3 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

An error in Nix installers before version 2.34.7 allows a local user to write to arbitrary files by exploiting a directory‑traversal flaw in the "nix-prefetch-url --unpack" and "nix store prefetch-file --unpack" commands. The flaw stems from unsanitized input that lets the commands access paths outside the intended directory, thus enabling unwanted file creation or modification. The weakness is a classic directory traversal (CWE‑36), and the impact is the ability to alter or replace configuration or executable files, potentially compromising system integrity and creating a foothold for further privilege escalation. This vulnerability is limited to local users who can run the affected Nix commands, but it can be used to write privileged files if the attacker can control the directory structure or target files that require higher permission bits after write, effectively enabling local privilege escalation.

Affected Systems

NixOS Nix package is affected. Versions prior to 2.34.7 are vulnerable, including 2.33.6, 2.32.8, 2.31.5, 2.30.5, 2.29.4, and 2.28.7 (the latest stable branch that received the fix is 2.24.7). All prior releases therefore remain at risk.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity. EPSS data is not available, and the vulnerability is not listed in CISA's KEV catalog. The attack vector is local; a user with access to the prefetched commands can fabricate traversal paths and overwrite target files. While the lack of a known public exploit reduces immediate threat, the local nature of the flaw means that environment misconfiguration or privilege separation failures could quickly turn it into a critical foothold. Administrators should consider the moderate CVSS rating, but given the potential for local privilege escalation, the risk is non‑negligible in mixed‑user environments.

Generated by OpenCVE AI on May 5, 2026 at 02:50 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Nix to version 2.34.7 or newer (including 2.33.6, 2.32.8, 2.31.5, 2.30.5, 2.29.4, or 2.28.7) to apply the fix
  • Restrict execution of "nix-prefetch-url --unpack" and "nix store prefetch-file --unpack" to privileged accounts or trusted users only, preventing untrusted users from triggering the flaw
  • Audit and adjust file system permissions on directories used for unpacking to ensure they are not writable by unprivileged users

Generated by OpenCVE AI on May 5, 2026 at 02:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 05 May 2026 03:00:00 +0000

Type Values Removed Values Added
Title Directory Traversal in Nix Prefetch Commands Allowing Local Arbitrary File Write

Tue, 05 May 2026 01:15:00 +0000

Type Values Removed Values Added
Description 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);
First Time appeared Nixos
Nixos nix
Weaknesses CWE-36
CPEs cpe:2.3:a:nixos:nix:*:*:*:*:*:*:*:*
Vendors & Products Nixos
Nixos nix
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-05-05T00:58:14.984Z

Reserved: 2026-05-05T00:51:05.139Z

Link: CVE-2026-44029

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-05T01:16:07.170

Modified: 2026-05-05T01:16:07.170

Link: CVE-2026-44029

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-05T03:00:10Z

Weaknesses