{"id":"CVE-2026-50014","aliases":["CVE-2026-50014","GHSA-p4xf-rf54-rj3x"],"related":[],"kind":"vulnerability","state":"published","title":"pnpm: Git Fetch Argument Injection via Lockfile resolution.commit","summary":"pnpm is a package manager. Prior to 10.34.0 and 11.4.0, 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. This vulnerability is fixed in 10.34.0 and 11.4.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pnpm is a package manager. Prior to 10.34.0 and 11.4.0, 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. This vulnerability is fixed in 10.34.0 and 11.4.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\npnpm 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.\n\n## Vulnerability Details\n\nThe vulnerable path is in `fetching/git-fetcher/src/index.ts`. When a git dependency host is configured for shallow fetching, pnpm calls:\n\n```typescript\nawait execGit(['fetch', '--depth', '1', 'origin', resolution.commit], { cwd: tempLocation })\n```\n\nBecause `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:\n\n```typescript\nawait execGit(['checkout', resolution.commit], { cwd: tempLocation })\n```\n\n`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.\n\n## Proof of Concept\n\n```bash\nbash autofyn_audit/exploits/vuln11_git_upload_pack_rce/exploit.sh\n# Creates a local bare git repo and triggers the shallow-fetch path.\n# Replaces the lockfile commit hash with '--upload-pack=touch /tmp/vuln11_pwned'.\n# Result: PASS -- /tmp/vuln11_pwned created by injected touch command.\n```\n\nThe PoC uses a local `file://githost/...` repository because the injection requires a local or SSH transport. HTTPS transport ignores `--upload-pack`.\n\n## Impact\n\nCode 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.\n\n## Suggested Remediation\n\nAdd a `--` separator before lockfile-controlled git revision values. Validate `resolution.commit` matches `/^[0-9a-f]{40}$/i` before passing to Git.\n\n---\n\n> Discovered by [AutoFyn](https://github.com/SignalPilot-Labs/AutoFyn)\n> Full audit report: [audit_report.md](https://github.com/tempcollab/pnpm/blob/main/autofyn_audit/audit_report.md)\n> Exploit script: [exploit.sh](https://github.com/tempcollab/pnpm/blob/main/autofyn_audit/exploits/vuln11_git_upload_pack_rce/exploit.sh)","format":"markdown","source":"ghsa"}],"published":"2026-06-25T16:51:16.652Z","modified":"2026-11-03T23:17:46.100Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","score":6.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","score":6.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N","score":6.4,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N","score":7.3,"rating":"HIGH"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"version":"< 10.33.4","status":"affected"},{"version":">= 11.0.0, < 11.4.0","status":"affected"}],"vendor":"pnpm","product":"pnpm","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"10.34.0"}],"ecosystem":"npm","package":"pnpm","purl":"pkg:npm/pnpm","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"11.0.0","status":"affected","fixed":"11.4.0"}],"ecosystem":"npm","package":"pnpm","purl":"pkg:npm/pnpm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"10.34.0"},{"status":"affected","introduced":"11.0.0","fixed":"11.4.0"}],"vendor":"pnpm","product":"pnpm","cpe":"cpe:2.3:a:pnpm:pnpm:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/pnpm/pnpm/security/advisories/GHSA-p4xf-rf54-rj3x","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50014","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pnpm/pnpm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-06-26T03:56:19.957Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-50014","url":"https://www.cve.org/CVERecord?id=CVE-2026-50014","licence":"CVE Terms of Use","modified":"2026-11-03T22:13:26.306Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p4xf-rf54-rj3x","url":"https://github.com/advisories/GHSA-p4xf-rf54-rj3x","licence":"CC-BY-4.0","modified":"2026-06-26T23:11:29.682Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-50014","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50014","licence":"Public domain","modified":"2026-11-03T23:17:46.100Z"}],"updatedAt":"2026-11-25T22:59:26.395Z","epss":{"score":0.00278,"percentile":0.21664,"date":"2026-12-01T12:00:22.000Z"}}