pnpm pacquet path traversal in lockfile dependency symlinks

Severity: low · CVSS 3.1 · Published 2026-09-01

pnpm is a popular Node.js package manager that uses lockfiles to manage project dependencies. A vulnerability in pnpm's pacquet component allows a malicious lockfile to create symbolic links that escape the project directory, potentially allowing an attacker to write files to arbitrary locations on the system when the lockfile is installed with trust enabled. This could lead to arbitrary code execution or system compromise.

Technologies: pnpm (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Low severity, with a CVSS score of 3.1, published 1 September 2026.
Which products and versions are affected?
pnpm (npm) SEMVER:introduced=12.0.0-alpha.0,fixed=12.0.0-alpha.5.
Is there a fix for This vulnerability?
Yes. pnpm (npm): upgrade to 12.0.0-alpha.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run pnpm (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pnpm (npm): upgrade to 12.0.0-alpha.5 or later
    npm install pnpm@12.0.0-alpha.5

Technical details

The vulnerability is a path traversal (CWE-22) and improper link resolution (CWE-59) issue in pacquet's install logic. When processing a crafted lockfile with dependency aliases containing traversal segments (e.g., `../../escaped-link`), the package manager could create symbolic links outside the project boundary without proper validation. The vulnerability affects both direct dependency links and global virtual-store slots, and can be exploited even when --trust-lockfile or frozen lockfiles are used. The fix adds a shared safe_join_modules_dir helper that validates all dependency names, virtual-store paths, and link destinations before filesystem materialization, rejecting absolute paths, reserved names, and traversal sequences. The patch was released in pnpm 12.0.0-alpha.5 and applied across install, symlink, bin, hoist, and virtual-store code paths.

Affected products

  • pnpm pnpm >=12.0.0-alpha.0, <12.0.0-alpha.5

Timeline

  • 2026-09-01: disclosed: GHSA-2rx9-3g3h-c2jv published
  • 2026-09-01: patched: Fix released in pnpm 12.0.0-alpha.5

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.