pnpm 12 path traversal via global virtual store (CVE-2026-145650, CVSS 10.0) lets a crafted package write files outside the store
pnpm 12.0.0 through versions before 12.10.0 has a path traversal flaw, CVE-2026-145650 (GHSA-jg5c-8mvg-5wph, CWE-22 and CWE-73). A dependency with a crafted package.json version string can write files outside the pnpm store during a fresh install. That can lead to code execution on developer machines and CI runners. The GitHub advisory scores it Critical, CVSS 10.0 (v3.1 vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H). The article says CVSS v4. The flaw only applies when enable-global-virtual-store=true, which is off by default. The article reports no confirmed exploitation, even though the advisory includes a proof of concept. The reporter is credited as Zhixi "Jace" Sun.
Entenda a falha
A vulnerabilidade
CVE-2026-145650 is a path traversal flaw (CWE-22 and CWE-73) in pnpm 12.0.0 up to versions before 12.10.0, fixed in 12.10.0. The GitHub advisory scores it Critical, CVSS 10.0 (v3.1); the securityonline.info article says CVSS v4. A dependency, direct or transitive, with a crafted package.json version string can write files outside the pnpm store during a fresh install. It only applies when enable-global-virtual-store=true, which is off by default. No privileges or user interaction are required, and the result can be code execution on developer machines and CI runners.
Como funciona
During a fresh or resolving install (pnpm install without a lockfile or with a stale one, pnpm add, pnpm update), pnpm fetches a package from a published tarball or a git source. It builds the store slot path for that package by copying the version string from its package.json straight into the path. Because .. segments are not blocked, the path can leave the store. pnpm then creates the escaped directory and writes the package files there. The frozen-lockfile path checks store bounds before writing, but the fresh-install path skips that check.
Por que é vulnerável
The root cause is missing validation of an untrusted value: the manifest version string is trusted and used as part of a filesystem path without sanitizing or rejecting .. parts. In addition, the bounds check on the store exists only on the frozen-lockfile path and was not applied on the fresh-install path, so the protection was inconsistent. The securityonline.info article places this in the Rust v12 engine. The fix validates dependency versions, enforces containment of slot directories and rejects traversal before slot directories are created.
Onde está
The advisory is GHSA-jg5c-8mvg-5wph. The fix appears to be upstream PR #16595 in pnpm/pnpm, "fix(package-manager): validate version and enforce slot containment in global virtual store" by zkochan; the story notes the PR page was not opened and the advisory does not link it.
Como foi descoberta
The flaw was reported by Zhixi "Jace" Sun and published as GitHub advisory GHSA-jg5c-8mvg-5wph. The articles do not say how it was found or give report and disclosure dates. The advisory header says affected versions are 12.0.0 up to before 12.10.0, while its body confirms the issue through 12.4.1 and says the first affected release could not be determined.
PoC pública
The official pnpm GitHub advisory includes a proof of concept that writes files into a temp folder, showing the traversal outside the store. The articles give no further detail on its maturity. No exploitation in the wild is confirmed (Brandefense, Rapid7 and VulDB, per securityonline.info). Likely overwrite targets are .git/hooks/pre-commit, node_modules/.bin and shell profiles. Since a public PoC exists, patching should not wait.
Explicação gerada por IA a partir da matéria e dos artigos, em 06/12/2026 07:15.
Detalhes técnicos
- pnpm copies the manifest
versionstring straight into the store slot path and does not block..segments (securityonline.info). - The frozen-lockfile path checks store bounds before it writes files. The fresh or resolving path (
pnpm installwith no or a stale lockfile,pnpm add,pnpm update) skips that check (securityonline.info, github.com/pnpm). - The attacker needs a malicious dependency, direct or transitive, delivered as a published tarball or a git package. The advisory also names a crafted lockfile in a pull request that CI installs as a vector (github.com/pnpm).
- The advisory lists no privileges or user interaction as required (github.com/pnpm).
- Likely overwrite targets are
.git/hooks/pre-commit,node_modules/.binand shell profiles (securityonline.info). - The advisory header says
>= 12.0.0, < 12.10.0. The body confirms the issue through 12.4.1 and says the first affected release could not be determined (github.com/pnpm).
Detalhes da correção
The fix is in pnpm 12.10.0. Upstream PR #16595, "fix(package-manager): validate version and enforce slot containment in global virtual store", by zkochan, appears to carry it (github.com/pnpm/pnpm, from search results). The PR page was not opened, and the advisory page does not link a fix PR. The change validates dependency versions and slot directories and rejects traversal before slot directories are created.
Remediação
- Update all developer machines and CI runners to pnpm 12.10.0 or later.
- If you cannot patch, keep
enable-global-virtual-storeoff, especially when adding third-party packages. - Review recent installs and CI jobs for unexpected files outside the store. Check
.git/hooks,node_modules/.binand shell startup files first.
Linha do tempo
-
pnpm 12 path traversal via global virtual store (CVE-2026-145650, CVSS 10.0) lets a crafted package write files outside the store
ler a análise desta fonte ocultar
pnpm 12.0.0 through versions before 12.10.0 has a path traversal flaw, CVE-2026-145650 (GHSA-jg5c-8mvg-5wph, CWE-22 and CWE-73). A dependency with a crafted
package.jsonversion string can write files outside the pnpm store during a fresh install. That can lead to code execution on developer machines and CI runners. The GitHub advisory scores it Critical, CVSS 10.0 (v3.1 vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H). The article says CVSS v4. The flaw only applies whenenable-global-virtual-store=true, which is off by default. The article reports no confirmed exploitation, even though the advisory includes a proof of concept. The reporter is credited as Zhixi "Jace" Sun.Technical Details
- pnpm copies the manifest
versionstring straight into the store slot path and does not block..segments (securityonline.info). - The frozen-lockfile path checks store bounds before it writes files. The fresh or resolving path (
pnpm installwith no or a stale lockfile,pnpm add,pnpm update) skips that check (securityonline.info, github.com/pnpm). - The attacker needs a malicious dependency, direct or transitive, delivered as a published tarball or a git package. The advisory also names a crafted lockfile in a pull request that CI installs as a vector (github.com/pnpm).
- The advisory lists no privileges or user interaction as required (github.com/pnpm).
- Likely overwrite targets are
.git/hooks/pre-commit,node_modules/.binand shell profiles (securityonline.info). - The advisory header says
>= 12.0.0, < 12.10.0. The body confirms the issue through 12.4.1 and says the first affected release could not be determined (github.com/pnpm).
Fix Details
The fix is in pnpm 12.10.0. Upstream PR #16595, "fix(package-manager): validate version and enforce slot containment in global virtual store", by zkochan, appears to carry it (github.com/pnpm/pnpm, from search results). The PR page was not opened, and the advisory page does not link a fix PR. The change validates dependency versions and slot directories and rejects traversal before slot directories are created.
Remediation
- Update all developer machines and CI runners to pnpm 12.10.0 or later.
- If you cannot patch, keep
enable-global-virtual-storeoff, especially when adding third-party packages. - Review recent installs and CI jobs for unexpected files outside the store. Check
.git/hooks,node_modules/.binand shell startup files first.
- pnpm copies the manifest