ZeroHour

CVE-2026-82392

mass

Path Traversal in pnpm Allows File Writes and Code Execution via pnpm-lock.yaml

CVSS 3.1
7.1 high
EPSS
<1%p33
Published
()
Modified
AI analysis

pnpm, a widely used JavaScript package manager, contains a path traversal flaw (CWE-22): the package name parsed from attacker-controlled entries in pnpm-lock.yaml is used without validation when building the dependency graph, allowing package contents to be written outside node_modules. An attacker who can control a project's pnpm-lock.yaml — for example via a malicious dependency update, a crafted pull request, or a cloned repository — can embed traversal sequences in the package keys so that when a user or CI system runs pnpm install, files are written outside the project's node_modules directory. If the project permits lifecycle scripts via dangerouslyAllowAllBuilds or a matching allowBuilds entry, the escaped package's install scripts can execute arbitrary code with the victim user's privileges; otherwise the impact is limited to arbitrary file writes. All pnpm users on versions prior to 10.34.5 or on 11.0.0 up to (but not including) 11.11.0 are exposed when installing from an untrusted lockfile. No public proof of concept is known, the issue is not in CISA's KEV catalog, and EPSS currently assigns a 0.4% probability of exploitation within 30 days (33rd percentile), so no in-the-wild exploitation has been reported; the CVSS 3.1 score is 7.1 (high).

What to do: Upgrade pnpm to 10.34.5 on the 10.x line or 11.11.0 on the 11.x line (or later). Until upgraded, avoid running pnpm install against lockfiles from untrusted sources and review lockfile changes in pull requests for traversal sequences in the packages keys; keep lifecycle scripts restricted (avoid dangerouslyAllowAllBuilds and scope allowBuilds entries) so an escaped package cannot execute code. Check for unexpected writes outside node_modules following installs performed from untrusted or externally modified lockfiles.

Affected
pnpmprior to 10.34.5
pnpm11.0.0 up to (but not including) 11.11.0
Estimated exposure
mass≈ millions of developer workstations and CI runners with the pnpm CLI installed or available — pnpm is one of the dominant JavaScript package managers with millions of weekly CLI downloads/installations across developer machines and CI pipelines (including availability via Node.js corepack), though actual attack exposure is narrower…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

pnpm is a package manager. Prior to 10.34.5 and from 11.0.0 until 11.11.0, pnpm parses the package name from attacker-controlled pnpm-lock.yaml packages keys with dp.parse(depPath).name and uses it without validation in deps/graph-builder/src/lockfileToDepGraph.ts and pnpm11/deps/graph-builder/src/lockfileToDepGraph.ts. The name reaches path.join(modules, pkgName), storeController.importPackage, and pnpm11/lockfile/to-pnp/src/index.ts, allowing package contents to be written outside node_modules when a user runs pnpm install. When dangerouslyAllowAllBuilds or a matching allowBuilds entry permits lifecycle scripts, the escaped package can execute code with the user's privileges. This issue is fixed in versions 10.34.5 and 11.11.0.

Weakness
CWE-22
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L

In the news

No ingested article mentions this CVE yet.