Medium

pnpm: Git Fetch Argument Injection via Lockfile resolution.commit

  • Disclosed: 26.06.2026
  • Updated: 11.10.2026 10:22

Summary

pnpm passes the lockfile-controlled git resolution.commit value to git fetch without a -- separator or commit-format validation. For git dependencies fetched through the shallow-fetch path, a malicious lockfile can replace the expected 40-character commit hash with a Git option such as --upload-pack=<command>. For SSH and local transports, --upload-pack can execute the supplied command. HTTPS transports ignore --upload-pack, so the practical attack surface is primarily SSH or local git dependencies.

Vulnerability Details

The vulnerable path is in fetching/git-fetcher/src/index.ts. When a git dependency host is configured for shallow fetching, pnpm calls:

ts
await execGit(['fetch', '--depth', '1', 'origin', resolution.commit], { cwd: tempLocation })

Because resolution.commit is appended before a -- separator, Git can parse a commit value beginning with - as an option. The same file later passes the value to git checkout without a separator:

ts
await execGit(['checkout', resolution.commit], { cwd: tempLocation })

resolution.commit comes from the lockfile and is typed as a plain string; pnpm does not validate it as a 40-character hexadecimal commit before passing it to Git.

Proof of Concept

bash
bash autofyn_audit/exploits/vuln11_git_upload_pack_rce/exploit.sh
# Creates a local bare git repo and triggers the shallow-fetch path.
# Replaces the lockfile commit hash with '--upload-pack=touch /tmp/vuln11_pwned'.
# Result: PASS -- /tmp/vuln11_pwned created by injected touch command.

The PoC uses a local file://githost/... repository because the injection requires a local or SSH transport. HTTPS transport ignores --upload-pack.

Impact

Code execution as the user running pnpm install, under specific transport conditions. The attacker must modify pnpm-lock.yaml, and the affected dependency must use SSH or local git transport. HTTPS transport (the common case) is immune.

Suggested Remediation

Add a -- separator before lockfile-controlled git revision values. Validate resolution.commit matches /^[0-9a-f]{40}$/i before passing to Git.


Discovered by AutoFyn Full audit report: audit_report.md Exploit script: exploit.sh

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package pnpm < 10.34.0, >= 11.0.0, < 11.4.0 10.34.0, 11.4.0

References

CVSS score 6.4/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N
Weakness (CWE)
CWE-88
Platform
npm
Package
pnpm
Disclosed
26.06.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-p4xf-rf54-rj3x - CC BY 4.0

Vulnerability history: pnpm

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (32) in the archive
Total entries
32
First → latest
03.2022 09.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 18
  • Medium 14

Disclosures per year

  1. 2022: 1
  2. 2023: 1
  3. 2024: 1
  4. 2025: 1
  5. 2026: 28
Severity:
  1. High · 7.1 CVE-2026-82392 < 10.34.5, >= 11.0.0, < 11.11.0 10.34.5, 11.11.0
  2. High · 7.5 CVE-2026-82393 < 10.34.5, >= 11.0.0, < 11.11.0 10.34.5, 11.11.0
  3. High · 7.4 CVE-2026-101043 >= 11.0.0, < 11.11.0, >= 10.7.0, < 10.34.5 11.11.0, 10.34.5
  4. High · 7.1 ghsa-2rx9-3g3h-c2jv >= 12.0.0-alpha.0, < 12.0.0-alpha.5 12.0.0-alpha.5
  5. High · 8.2 CVE-2026-59195 < 10.34.4, >= 11.0.0, < 11.8.0 10.34.4, 11.8.0
  6. High · 7.1 CVE-2026-59194 < 10.34.4, >= 11.0.0, < 11.7.0 10.34.4, 11.7.0
  7. High · 7.1 CVE-2026-59196 < 10.34.4, >= 11.0.0, < 11.7.0 10.34.4, 11.7.0
  8. High · 8.8 CVE-2026-55698 < 10.34.2, >= 11.0.0, < 11.5.3 10.34.2, 11.5.3
  9. High · 7.5 CVE-2026-55697 < 10.34.2, >= 11.0.0, < 11.5.3 10.34.2, 11.5.3
  10. High · 7.5 CVE-2026-55487 < 10.34.2, >= 11.0.0, < 11.5.3 10.34.2, 11.5.3
  11. High · 7.3 CVE-2026-50015 < 10.34.0, >= 11.0.0, < 11.4.0 10.34.0, 11.4.0
  12. High · 8.8 CVE-2026-50016 < 10.34.0, >= 11.0.0, < 11.4.0 10.34.0, 11.4.0
  13. pnpm: Git Fetch Argument Injection via Lockfile resolution.commit this entry
    Medium · 6.4 CVE-2026-50014 < 10.34.0, >= 11.0.0, < 11.4.0 10.34.0, 11.4.0
  14. High · 8.8 CVE-2025-69264 >= 10.0.0, < 10.26.0 10.26.0
  15. High · 7.5 CVE-2025-69262 >= 6.25.0, < 10.27.0 10.27.0
  16. High · 7.5 CVE-2023-37478 < 7.33.4, >= 8.0.0, < 8.6.8 7.33.4, 8.6.8
  17. High · 8.8 CVE-2022-26183 < 6.15.1 6.15.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.