Back to Intelligence

CVE-2026-145650: Critical pnpm Path Traversal (CVSS 10) — Detection, Hunting, and Remediation Guide

SA
Security Arsenal Team
December 5, 2026
11 min read

On the surface, a package manager vulnerability sounds like a developer problem. CVE-2026-145650 is not. NVD has published a CVSS 10.0 (CRITICAL), network-exploitable path traversal vulnerability in pnpm versions 12.0.0 through (but not including) 12.10.0 — one of the most widely deployed JavaScript package managers in modern CI/CD pipelines. The flaw allows a malicious dependency, using nothing more exotic than a crafted version string in its package manifest, to write files outside the pnpm content-addressable store when enable-global-virtual-store is enabled.

The practical impact is severe: an attacker who publishes or poisons a dependency can overwrite arbitrary files on the installing machine — the summary's own example is git hooks, which is a direct, reliable path to arbitrary code execution the next time a developer or build agent runs a git operation. Every developer workstation, every CI runner, and every ephemeral build container that resolves a malicious dependency with a vulnerable pnpm version is in scope.

This is a supply-chain primitive. You will not see an exploit binary hit your perimeter. You will see it land as a transitive dependency in a pnpm-lock.yaml change that nobody reviewed. Defenders need to patch, audit configuration, and hunt for signs that crafted version strings have already traversed their pipelines.

Technical Analysis

Affected Products and Versions

  • Product: pnpm (the performant, content-addressable package manager in the npm ecosystem)
  • Affected versions: 12.0.0 up to and including anything before 12.10.0 (i.e., >= 12.0.0, < 12.10.0)
  • Fixed version: 12.10.0
  • Triggering configuration: enable-global-virtual-store must be enabled (this is not the default in most configurations, but it is commonly turned on in monorepo and CI environments to deduplicate disk usage)
  • Platforms: All platforms running vulnerable pnpm — Linux, macOS, Windows; developer workstations and CI/CD build agents alike

Note on the news headline: while the CVE title references "npm" broadly as the affected ecosystem, the technical specifics in the NVD record identify pnpm as the vulnerable component. Do not assume you are unaffected because your organization "only uses npm or yarn" — pnpm has substantial enterprise adoption, and many monorepo toolchains (Nx, Turborepo, Rush) use pnpm under the hood.

How the Vulnerability Works

pnpm's content-addressable store isolates packages from the projects that consume them. With enable-global-virtual-store enabled, pnpm builds slot paths — directory paths inside the virtual store — from metadata in the dependency's manifest. The vulnerable code path constructs these slot paths using the dependency's version string without validation or sanitization during fresh installs or when resolving.

A malicious package can therefore ship a manifest with a version value containing path traversal sequences, e.g.:

Code
"version": "1.0.0/../../../../../.git/hooks"

Because the version is concatenated into the slot path, the traversal segments escape the intended store root. pnpm then writes package content to the attacker-controlled location. The canonical target called out in the disclosure is .git/hooks/ — dropping a pre-commit, post-checkout, or pre-push hook gives the attacker code execution in the context of whoever next interacts with that repository. Other high-value targets include:

  • Shell profiles and rc files (~/.bashrc, ~/.zshrc) for persistent execution
  • SSH configuration or authorized keys
  • CI configuration files that execute on subsequent pipeline stages
  • IDE workspace settings with auto-run tasks (e.g., VS Code tasks.json with runOn: folderOpen)

Exploitation requirements: the victim must (1) run a vulnerable pnpm version, (2) have enable-global-virtual-store enabled, and (3) install/resolve a dependency graph containing the malicious manifest — which can happen transitively, several levels deep, with no obvious signal in package.json.

Exploitation Status

As of publication, CVE-2026-145650 has a published NVD record with a CVSS 10.0 network vector and a fully described attack mechanism — the vulnerability pathway is well understood and does not require authentication or user interaction beyond a normal install operation. The technique is trivially reproducible from the description (a crafted manifest string), which historically means weaponization moves quickly in the npm ecosystem. There is no confirmed CISA KEV entry at time of writing, but given the CVSS 10 score, the network exploitability, and the supply-chain blast radius, treat this as an imminent-exploitation risk and patch within days, not weeks.

Detection & Response

The defender's observables here are concrete: (1) pnpm install processes with traversal sequences in resolved manifests or lockfiles, (2) node/pnpm processes writing outside expected store paths — especially into .git/hooks, and (3) git hook files modified around install events.

SIGMA Rules

YAML
---
title: Package Manager Process Writing to Git Hooks Directory
id: 3f8a2c71-9b4e-4d52-a8c6-1e7f2a5b9d01
status: experimental
description: Detects node.js-based package managers (pnpm/npm/yarn) writing files into .git/hooks directories, consistent with CVE-2026-145650 path traversal exploitation where a crafted manifest version string escapes the virtual store and overwrites git hooks for code execution.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-145650
  - https://attack.mitre.org/techniques/T1195/002/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.supply_chain_compromise
  - attack.t1195.002
  - attack.persistence
logsource:
  category: file_event
  product: windows
detection:
  selection_image:
    Image|endswith:
      - '\node.exe'
      - '\pnpm.exe'
      - '\pnpm.CMD'
      - '\npm.CMD'
      - '\yarn.CMD'
  selection_target:
    TargetFilename|contains:
      - '\.git\hooks\'
  condition: selection_image and selection_target
falsepositives:
  - Git hook management tools such as husky or simple-git-hooks invoked during install scripts (validate file content and install context)
level: high
---
title: Suspicious Traversal Sequence in Package Manager Command Line or Lockfile Context
id: 8c1e4b92-2d7a-4f36-b91d-4a6c8e2f5b73
status: experimental
description: Detects pnpm install/resolve operations where path traversal sequences appear in arguments or where pnpm executes with global virtual store enabled — an environment prerequisite for CVE-2026-145650. Review any traversal strings in package resolution output as potential malicious manifest version values.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-145650
  - https://attack.mitre.org/techniques/T1204/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.supply_chain_compromise
  - attack.t1195.002
logsource:
  category: process_creation
  product: linux
detection:
  selection_pnpm:
    CommandLine|contains:
      - 'pnpm install'
      - 'pnpm add'
      - 'pnpm i '
      - 'pnpm update'
  selection_traversal:
    CommandLine|contains:
      - '../'
      - '..%2f'
      - '..\u002f'
  condition: selection_pnpm and selection_traversal
falsepositives:
  - Legitimate relative-path workspace dependencies (review carefully; version strings should never contain traversal sequences)
level: medium
---
title: Git Hook File Modified Around Dependency Install Activity
id: 5d2b7f48-1c93-4e61-a7d4-9f3b6c8a2e15
status: experimental
description: Detects modification or creation of executable git hook scripts by non-git processes, a persistence and code-execution technique leveraged by CVE-2026-145650 exploitation to run attacker code on the next git operation.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-145650
  - https://attack.mitre.org/techniques/T1037/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.persistence
  - attack.t1037
  - attack.t1195.002
logsource:
  category: file_event
  product: linux
detection:
  selection_path:
    TargetFilename|contains:
      - '/.git/hooks/pre-commit'
      - '/.git/hooks/post-checkout'
      - '/.git/hooks/pre-push'
      - '/.git/hooks/post-merge'
      - '/.git/hooks/commit-msg'
  filter_git:
    Image|endswith:
      - '/git'
      - '/husky'
  condition: selection_path and not filter_git
falsepositives:
  - Husky, lefthook, or other hook managers during initial project scaffolding (tune to your standard toolchain)
level: high

KQL — Microsoft Sentinel / Defender

This query hunts across endpoints for pnpm install activity correlated with writes into git hook directories — the primary code-execution pathway for this CVE. It also surfaces pnpm processes whose command lines contain traversal sequences.

KQL — Microsoft Sentinel / Defender
let lookback = 14d;
let InstallActivity = DeviceProcessEvents
| where TimeGenerated > ago(lookback)
| where ProcessCommandLine has_any ("pnpm install", "pnpm add", "pnpm i ", "pnpm update")
| project InstallTime=TimeGenerated, DeviceId, DeviceName, AccountName, InstallCmd=ProcessCommandLine;
DeviceFileEvents
| where TimeGenerated > ago(lookback)
| where FolderPath has_any (".git/hooks/", ".git\\hooks\\")
| where InitiatingProcessFileName in~ ("node.exe", "node", "pnpm", "pnpm.exe", "npm", "yarn")
   or InitiatingProcessCommandLine has "pnpm"
| join kind=inner InstallActivity on DeviceId
| where abs(datetime_diff('minute', TimeGenerated, InstallTime)) <= 30
| project HookWriteTime=TimeGenerated, DeviceName, AccountName,
          HookFile=FolderPath, InitiatingProcessCommandLine, InstallCmd, SHA256
| order by HookWriteTime desc;
// Secondary hunt: traversal sequences in package-manager command lines
DeviceProcessEvents
| where TimeGenerated > ago(lookback)
| where ProcessCommandLine has "pnpm"
| where ProcessCommandLine has_any ("../", "..\\", "..%2f")
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessCommandLine;

Velociraptor VQL

Use this hunt artifact to sweep endpoints for git hooks modified recently in combination with pnpm presence — rapid triage to identify machines that warrant deeper DFIR.

VQL — Velociraptor
-- CVE-2026-145650 triage: enumerate recently modified git hooks and pnpm processes
-- Looks for hook files touched within the last 7 days across repo roots
LET hooks = SELECT FullPath, Mtime, Size,
       read_file(filename=FullPath, length=256) AS HookHead
FROM glob(globs='**/.git/hooks/*', root='/')
WHERE NOT IsDir
  AND NOT FullPath =~ '\\.sample$'
  AND Mtime > now() - 7 * 24 * 3600

LET procs = SELECT Pid, Name, CommandLine, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ 'pnpm (install|add|i |update)'

SELECT * FROM hooks
UNION ALL
SELECT NULL AS FullPath, NULL AS Mtime, NULL AS Size, NULL AS HookHead,
       Pid, Name, CommandLine, Username, CreateTime FROM procs

For Windows fleets, adjust the glob root to user profile and repo base paths (e.g., C:/Users/*/source/**/.git/hooks/*). Correlate hook modification timestamps with your package install logs before declaring a hit malicious — legitimate hook managers exist, but a hook written by a node process during a pnpm install window that nobody scaffolded is a strong lead.

Remediation / Verification Script

Run this on developer workstations, build agents, and golden CI images to identify vulnerable pnpm versions, flag the dangerous configuration, and scan lockfiles for traversal-bearing version strings.

Bash / Shell
#!/bin/bash
# CVE-2026-145650 verification and triage script (Linux/macOS build agents and dev machines)

echo "=== [1] pnpm version check ==="
if command -v pnpm >/dev/null 2>&1; then
  VER=$(pnpm --version 2>/dev/null)
  echo "Installed pnpm version: $VER"
  MAJOR=$(echo "$VER" | cut -d. -f1)
  MINOR=$(echo "$VER" | cut -d. -f2)
  if [ "$MAJOR" -eq 12 ] && [ "$MINOR" -lt 10 ]; then
    echo "[!] VULNERABLE: pnpm $VER is in the affected range (>=12.0.0, <12.10.0). Upgrade immediately:"
    echo "    npm install -g pnpm@latest   # or: corepack prepare pnpm@12.10.0 --activate"
  else
    echo "[OK] pnpm $VER is outside the affected range."
  fi
else
  echo "pnpm not found on PATH. Check CI images and corepack shims separately."
fi

echo ""
echo "=== [2] enable-global-virtual-store configuration check ==="
pnpm config get enable-global-virtual-store 2>/dev/null
grep -Rsn "enable-global-virtual-store" ~/.npmrc ./.npmrc /usr/local/etc/npmrc 2>/dev/null
echo "If 'true' appears above with a vulnerable pnpm version, exposure is confirmed."

echo ""
echo "=== [3] Scan lockfiles for traversal sequences in version fields ==="
find . -maxdepth 6 -name "pnpm-lock.yaml" 2>/dev/null | while read -r f; do
  HITS=$(grep -nE "version:.*(\.\./|\.\.\\\\|%2e%2e)" "$f" 2>/dev/null)
  if [ -n "$HITS" ]; then
    echo "[!] SUSPICIOUS version strings in $f:"
    echo "$HITS"
  fi
done

echo ""
echo "=== [4] Recently modified git hooks (last 7 days) ==="
find ~ -maxdepth 8 -path "*/.git/hooks/*" -type f -mtime -7 ! -name "*.sample" 2>/dev/null | while read -r h; do
  echo "$(stat -c '%y' "$h" 2>/dev/null || stat -f '%Sm' "$h")  $h"
done

echo ""
echo "=== [5] Upgrade command (run after review) ==="
echo "npm install -g pnpm@12.10.0 && pnpm config set enable-global-virtual-store false"

Remediation

  1. Upgrade pnpm to 12.10.0 or later everywhere — developer workstations, CI/CD runners, Docker base images, and corepack-managed shims. Do not forget ephemeral build containers: scan your image registry for pnpm versions baked into layers (docker run --rm <image> pnpm --version).
  2. Disable enable-global-virtual-store until patched. If you cannot upgrade immediately, setting enable-global-virtual-store false in .npmrc (project and user scope) removes the vulnerable code path. Expect a disk-usage increase in monorepos — that is an acceptable trade against a CVSS 10.
  3. Audit lockfiles and manifests for traversal strings. Version fields should match a strict semver pattern. Any ../, encoded traversal (%2e%2e, ..%2f), or backslash sequences in a version value is a hostile indicator — quarantine the package and investigate how it entered your dependency graph.
  4. Review git hooks across active repositories. Compare hook contents against your known-good toolchain (husky, lefthook). Re-clone repositories or restore hooks from a trusted state on any machine that installed dependencies with a vulnerable pnpm and the global virtual store enabled.
  5. Enforce dependency provenance controls going forward: pin exact versions in lockfiles, require lockfile diffs in PR review, use a private registry proxy (Artifactory, Nexus, Verdaccio) with malware screening, and consider disabling lifecycle scripts (--ignore-scripts) in CI where feasible.
  6. Rotate credentials on any confirmed-exposed machine. Git hook execution runs in the developer/build context — SSH keys, cloud tokens, and registry credentials on that host should be treated as compromised if exploitation is confirmed.
  7. Monitor the NVD record (https://nvd.nist.gov/vuln/detail/CVE-2026-145650) and the pnpm GitHub security advisories for updated indicators, and watch for a CISA KEV addition which would trigger federal remediation deadlines for FCEB agencies and serve as a forcing function for private-sector patch SLAs.

The supply-chain lesson here is one we keep relearning: the package manager itself is part of your attack surface, and "it's just a version string" is exactly the kind of unvalidated input attackers build careers on. Patch the tool, audit the config, and hunt the artifact.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.