CVE-2026-59196 pnpm Lockfile Traversal and Directory Overwrite Vulnerability
pnpm, a widely-used Node.js package manager, contains a lockfile parsing vulnerability that allows a specially crafted lockfile to create directory traversal or reserved directory overwrites. An attacker who controls a lockfile (via a malicious package, compromised repository, or supply chain attack) can manipulate how pnpm installs dependencies, potentially writing files to unexpected locations or overwriting critical pnpm internal directories. The vulnerability requires user interaction—specifically, running pnpm on a malicious lockfile—but no authentication is required. Versions prior to 10.34.4 and 11.7.0 are affected.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.1 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
- Weaknesses (CWE)
- CWE-22, CWE-73
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-06 / 2026-07-07
NVD description (verbatim)
pnpm is a package manager. Prior to 10.34.4 and 11.7.0, a crafted lockfile alias could be joined directly under a hoisted node_modules directory. Traversal aliases could escape that directory, while reserved aliases such as .bin or .pnpm could overwrite pnpm-owned layout. This vulnerability is fixed in 10.34.4 and 11.7.0.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from insufficient validation of alias names in pnpm lockfiles during the hoisted module resolution phase. Lockfile aliases are parsed and joined into the node_modules directory structure without proper sanitization. Two distinct attack vectors emerge: (1) Path traversal aliases that escape the intended hoisted directory hierarchy (CWE-22), and (2) Reserved alias names such as '.bin' or '.pnpm' that collide with pnpm's internal layout directories (CWE-73). When a crafted lockfile contains such aliases, they are written directly into the filesystem with the privileges of the user running pnpm, potentially corrupting the dependency tree or injecting malicious executables into reserved directories that pnpm uses for its own operations.
Business impact
This vulnerability primarily affects development and CI/CD pipelines where pnpm is used. A developer or automated build system that installs dependencies from a compromised lockfile could have their node_modules directory corrupted, resulting in broken builds, unexpected behavior, or execution of injected code. Organizations relying on pnpm for supply chain tooling face elevated risk if lockfiles are pulled from untrusted sources or if repositories have been compromised. The impact is contained to the affected machine's node_modules and build artifacts, but in CI/CD contexts, this could propagate compromised packages downstream. The HIGH severity reflects the combination of high integrity impact and ease of exploitation via file manipulation.
Affected systems
pnpm versions 10.34.3 and earlier (in the 10.x line) and 11.6.0 and earlier (in the 11.x line) are vulnerable. Any system using pnpm to install Node.js dependencies is at risk if it processes a malicious or compromised lockfile. This includes local development environments, CI/CD runners (GitHub Actions, GitLab CI, Jenkins, etc.), Docker build stages, and any automation that invokes pnpm install or pnpm ci with user-supplied or untrusted lockfiles.
Exploitability
Exploitability is straightforward from a technical standpoint: an attacker need only craft a malicious pnpm-lock.yaml or pnpm-lock.json file with crafted alias entries and place it in a repository or supply chain. The CVSS vector (AV:N/AC:L/PR:N/UI:R) indicates network-accessible, low complexity, no privileges required, but user interaction needed. The user interaction is simply running pnpm install or a CI job that does so. No advanced techniques or zero-day exploitation is required; the attack is deterministic once the lockfile is introduced. However, the vulnerability does not propagate automatically—it requires the user to execute pnpm against the malicious lockfile, which limits opportunistic large-scale exploitation but makes targeted supply chain attacks highly viable.
Remediation
Upgrade pnpm to version 10.34.4 or later (for the 10.x series) or 11.7.0 or later (for the 11.x series). These versions include input validation fixes for lockfile alias parsing that reject or safely handle traversal and reserved directory names. After upgrading, regenerate lockfiles from trusted sources (via pnpm install on a clean, trusted machine) and review any lockfiles that may have been processed by vulnerable versions for signs of tampering.
Patch guidance
1. Identify all systems and pipelines using pnpm. Check pnpm version with 'pnpm --version'. 2. Prioritize CI/CD and shared development environments. 3. Upgrade pnpm globally or per-project to the patched versions: run 'pnpm add -g pnpm@latest' or update package.json and package-lock files accordingly. 4. For monorepo or workspace setups, ensure the root pnpm version is updated. 5. After upgrading, run 'pnpm install' or 'pnpm ci' to regenerate or validate lockfiles. 6. If lockfiles were modified or created before patching, audit them for suspicious alias entries or manually verify their integrity from VCS history.
Detection guidance
Look for lockfile commits or changes that introduce unusual alias entries, especially those containing path separators ('/', '\'), dots ('..'), or reserved directory names ('.bin', '.pnpm', etc.). In CI/CD logs, monitor for pnpm install failures or unexpected file writes outside the node_modules tree. Use file integrity monitoring (e.g., auditd on Linux) to catch unexpected writes during pnpm execution. Code review processes should flag lockfile changes with scrutiny equal to package.json changes. In Git, inspect lockfile diffs for suspicious alias entries: 'git log -p pnpm-lock.yaml | grep -E "alias|\.\."'.
Why prioritize this
Prioritize patching because: (1) pnpm is integral to modern Node.js development ecosystems; (2) lockfiles are frequently synchronized across teams and CI/CD, amplifying supply chain risk; (3) the attack requires no authentication and only user interaction to trigger; (4) CI/CD automation means lockfiles may be processed without human review; (5) the vulnerability enables file overwriting and code injection, which are high-integrity impacts. Organizations with strict supply chain security postures should treat this as a medium-term priority (patch within 2-4 weeks). Those with high exposure in CI/CD or public-facing development should expedite to 1-2 weeks.
Risk score, explained
CVSS 7.1 (HIGH) reflects: high integrity impact (I:H) from file overwriting and layout corruption, low availability impact (A:L) from potential build failures, but no confidentiality impact (C:N) since the vulnerability does not leak data. The network and low-complexity vector indicates the attack can originate remotely and requires minimal attacker sophistication. User interaction (lockfile installation) is a mitigating factor but not a strong one in automated CI/CD contexts. The score appropriately captures a real but not critical threat—organizations can mitigate through access controls on lockfiles and rapid patching.
Frequently asked questions
Can this vulnerability be exploited if I only use pnpm in a private, air-gapped development environment?
Risk is significantly reduced but not eliminated. The primary vector is a malicious lockfile, which typically enters via repository cloning, package management, or collaboration. In a truly air-gapped environment with strict code review and no external lockfile sources, your exposure is minimal. However, if developers pull code from shared repositories or if lockfiles are generated by untrusted CI systems, the risk remains. Patching is still recommended for defense in depth.
Does this affect packages I install with pnpm, or only the pnpm tool itself?
This affects pnpm itself, not the packages. The vulnerability is in how pnpm parses and writes the lockfile to the node_modules directory. A malicious lockfile can corrupt pnpm's internal layout (.pnpm, .bin directories) or escape the node_modules boundary, but it does not directly compromise the integrity of the installed packages themselves. However, by overwriting reserved directories, an attacker could inject malicious executables that masquerade as legitimate package files.
What should I do if I've been running an old pnpm version and don't know if my lockfile is compromised?
Regenerate the lockfile after patching. On a freshly patched system, delete the existing pnpm-lock.yaml and run 'pnpm install' to create a new lockfile. Compare the new lockfile to any backed-up versions in version control; significant differences may indicate tampering. If you have Git history, examine lockfile commits for unusual alias entries. If you suspect active compromise, rebuild the environment from scratch and review any build artifacts or deployed packages from that machine.
Does pnpm version 12.x or later exist, and is it affected?
Verify against the pnpm release notes and GitHub repository. The provided vulnerability data specifies fixes in 10.34.4 and 11.7.0; if pnpm 12.x exists and post-dates those fixes, it should be patched. However, always verify the actual version numbers and patch status from the official pnpm repository before assuming a version is safe.
This analysis is based on CVE-2026-59196 as published. Version numbers, affected ranges, and patch availability are as stated in the CVE record and should be verified against the official pnpm project repository and security advisories before taking action. No exploit code or proof-of-concept details are provided. Organizations should conduct their own risk assessments and testing in non-production environments before deploying patches. This explainer is informational and does not constitute professional security advice; consult your security team for guidance specific to your environment and threat model. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-55700HIGHpnpm Path Traversal in Package Download
- CVE-2026-59194HIGHpnpm Path Traversal in Patch Removal – HIGH Severity
- CVE-2026-55699MEDIUMpnpm Path Traversal in Global Package Removal
- CVE-2026-46402HIGHPath Traversal in Microsoft UFO Framework – Patch Guidance
- CVE-2026-58192HIGHAppium Storage Plugin Path Traversal – Arbitrary File Deletion
- CVE-2026-13748MEDIUMSnowflake CLI Path Traversal – Local File Disclosure
- CVE-2026-41412MEDIUMalf.io Extension Sandbox File Read Vulnerability
- CVE-2026-46397MEDIUMAuthenticated Local File Inclusion in HAX CMS (MEDIUM)