HIGH 8.2

CVE-2026-59195: pnpm Path Traversal in Config Dependencies

pnpm, a widely-used Node.js package manager, contains a path traversal vulnerability in how it processes lockfile configuration dependencies. When a developer runs pnpm install on a project with a malicious pnpm-lock.yaml file, an attacker can craft dependency names that bypass directory restrictions and create symlinks outside the intended node_modules/.pnpm-config location. This allows an attacker to write files to arbitrary locations on the developer's system, potentially overwriting critical files or injecting malicious code into the project. The vulnerability requires user interaction (running pnpm install), but affects development environments across multiple operating systems.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.2 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:L
Weaknesses (CWE)
CWE-22
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.8.0, pnpm accepts package names from the env lockfile configDependencies section and uses those names directly when creating config dependency symlinks under node_modules/.pnpm-config. A malicious repository can commit a crafted pnpm-lock.yaml whose env-lockfile document contains a traversal-shaped config dependency name. During pnpm install, pnpm installs the config dependency and creates a symlink at a path derived from that name. This vulnerability is fixed in 10.34.4 and 11.8.0.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-59195 is a path traversal vulnerability (CWE-22) in pnpm's handling of the env-lockfile document's configDependencies section within pnpm-lock.yaml. The package manager fails to sanitize or validate package names before using them to construct symlink paths under node_modules/.pnpm-config. An attacker who controls a repository can embed traversal sequences (e.g., ../) in config dependency names. During install, pnpm processes these unsanitized names and creates symlinks at paths influenced by the attacker's input, enabling arbitrary file write access relative to the project root. The vulnerability stems from insufficient input validation at the point where lockfile entries are translated into filesystem operations.

Business impact

Development teams using pnpm are at risk of supply-chain compromise through poisoned lockfiles in shared repositories. An attacker gaining control of a project repository (or a dependency repository with transitive lockfile inclusion) can inject arbitrary files or overwrite existing project files during routine dependency installation. This creates a silent compromise vector—developers may unknowingly execute malicious code injected into build scripts, configuration files, or application code. For organizations managing multiple projects or using monorepos, a single compromised lockfile can affect numerous teams. The impact is heightened in CI/CD pipelines where pnpm install runs automatically and with elevated privileges.

Affected systems

pnpm versions prior to 10.34.4 (in the 10.x branch) and prior to 11.8.0 (in the 11.x branch) are vulnerable. The vulnerability affects any development environment or CI/CD system running an affected version of pnpm, regardless of operating system. Node.js projects of any size that depend on pnpm for package management are in scope. The attack surface is particularly broad because the malicious pnpm-lock.yaml file can be committed to any shared or public repository, affecting all downstream consumers of that code.

Exploitability

Exploitability is rated as HIGH because the vulnerability requires no special privileges to trigger—any developer cloning a compromised repository and running pnpm install will execute the attack. The only prerequisite is user interaction (running the install command), which is routine and expected. An attacker needs only repository write access (or control of a dependency repository) to inject a crafted lockfile. No authentication bypass or complex setup is required, and the attack leaves minimal forensic traces, making detection difficult without careful examination of lockfile changes.

Remediation

Organizations must upgrade pnpm immediately to version 10.34.4 (for the 10.x series) or 11.8.0 (for the 11.x series), where input validation has been added to sanitize config dependency names. Simultaneously, audit all pnpm-lock.yaml files in use for suspicious config dependency entries, particularly those containing path traversal sequences (../, ..\, or similar patterns). Review repository access controls and commit history to identify potentially compromised lockfiles. Consider enabling lockfile signature verification if available, and establish a policy requiring lockfile review before merging to main branches.

Patch guidance

Upgrade pnpm via your package manager of choice (npm, yarn, or manual binary download). For npm global installation: npm install -g pnpm@latest. For projects using a specific pnpm version in .npmrc or packageManager field, update those version constraints to 10.34.4 or later for 10.x users, or 11.8.0 or later for 11.x users. Verify the upgrade by running pnpm --version and confirm the version matches or exceeds the fixed versions. After upgrading, re-run pnpm install to validate that lockfiles parse correctly and no warnings about invalid dependency names appear. Test in a non-production environment first to rule out compatibility issues with project-specific configurations.

Detection guidance

Monitor pnpm-lock.yaml commits for changes to the configDependencies section, particularly additions of entries containing ../, ..\, or other path traversal patterns. Implement pre-commit hooks that reject lockfiles with suspicious config dependency names. In CI/CD, log and alert on pnpm install commands that process lockfiles with unrecognized or anomalous dependency entries. Examine filesystem logs for symlink creation outside expected node_modules/.pnpm-config paths. Use file integrity monitoring on critical project files (package.json, .env, build scripts) to detect unauthorized modifications during or after pnpm operations. For historical detection, search git logs for lockfile changes introducing potential traversal sequences in the configDependencies field.

Why prioritize this

This vulnerability merits immediate remediation despite not yet appearing on the CISA KEV list. The CVSS 8.2 HIGH score reflects the combination of network exploitability, low attack complexity, and high integrity impact. The absence of authentication requirements and the routine nature of pnpm install make this a low-friction attack. For development and CI/CD environments, the ability to silently inject code into projects poses substantial risk to build integrity and downstream software supply. The fix is straightforward (version upgrade) and widely available, making delay indefensible.

Risk score, explained

The CVSS 3.1 score of 8.2 (HIGH) is driven by several factors: Attack Vector (Network) reflects that the malicious lockfile can be distributed remotely; Attack Complexity (Low) means no special conditions or configuration are needed; Privileges Required (None) and User Interaction (Required) together indicate that any user running pnpm install triggers the vulnerability; Scope (Changed) indicates impact extends beyond the vulnerable component to the broader system; Confidentiality (None) and Integrity (High) show that data corruption or code injection is the primary threat; and Availability (Low) acknowledges potential for denial of service through filesystem exhaustion or critical file overwrites. The score reflects a significant but not critical threat that demands swift action in most environments.

Frequently asked questions

Does this vulnerability require the attacker to compromise the pnpm package itself?

No. The attacker needs only to control or gain write access to a repository whose pnpm-lock.yaml file is consumed downstream. This could be a public open-source project, a private dependency, or an organization's main repository. No compromise of the pnpm package or npm registry is required.

Can this vulnerability be exploited in offline or air-gapped environments?

Only if the malicious pnpm-lock.yaml file reaches those environments through another mechanism (e.g., checked-in to version control, transferred on physical media, or shared via artifact repositories). The vulnerability itself is not network-enabled; it activates during local pnpm install execution.

What's the difference between this and other supply-chain vulnerabilities in Node.js?

Unlike vulnerabilities in packages themselves, this attack exploits the lockfile format—a file that developers often trust implicitly because it pins exact versions. An attacker doesn't need to publish a malicious package to npm; they only need to craft a lockfile entry, making this attack faster and harder to detect through package signature verification alone.

Are there workarounds if we cannot upgrade immediately?

Temporary mitigations include: manually auditing pnpm-lock.yaml for suspicious configDependencies entries before running install; disabling automatic lockfile generation; and using read-only repository access where possible. However, these are not reliable long-term solutions. Upgrade should be prioritized.

This analysis is provided for informational purposes based on available vulnerability disclosures as of the publication date. While we strive for accuracy, we do not independently verify all vendor claims or patch completeness. Organizations should consult official pnpm security advisories and vendor documentation before implementing patches. This content does not constitute professional security advice; engage qualified security personnel to assess risk and remediation in your specific environment. Patch versions and vulnerability details are subject to change as additional information emerges. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).