CVE-2026-50014: pnpm: Git Fetch Argument Injection via Lockfile resolution.commit

Published Jun 25, 2026
·
Updated

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:

typescript 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:

typescript 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 autofynaudit/exploits/vuln11gituploadpackrce/exploit.sh Creates a local bare git repo and triggers the shallow-fetch path. Replaces the lockfile commit hash with '--upload-pack=touch /tmp/vuln11pwned'. Result: PASS -- /tmp/vuln11pwned 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: auditreport.md > Exploit script: exploit.sh

Other sources

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.

NVD

Affected Software

5 affected componentsFixes available
pnpm>10.34.0<11.4.0
npm/pnpm>=11.0.0<11.4.0
11.4.0
npm/pnpm<10.34.0
10.34.0
PNPM Pnpm Node.js<10.34.0
PNPM Pnpm Node.js>=11.0.0<11.4.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/pnpm to a version that resolves this vulnerability.

    Fixed in 11.4.0
  2. Upgrade

    Upgrade npm/pnpm to a version that resolves this vulnerability.

    Fixed in 10.34.0
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 10.34.0
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 11.4.0
  5. Configuration

    Validate `resolution.commit` from `pnpm-lock.yaml` matches `/^[0-9a-f]{40}$/i` before passing it to Git. This prevents injection via option-like values (e.g., `--upload-pack=...`) when pnpm performs `git fetch`/`git checkout`.

    pnpm (git-fetcher; fetching/git-fetcher/src/index.ts) resolution.commit validation = Match /^[0-9a-f]{40}$/i before passing to Git
  6. Configuration

    Add a `--` separator before lockfile-controlled git revision values so Git cannot parse a commit value beginning with `-` as an option (fix applies to the value appended prior to `--` and should also be used for both the `git fetch` and the later `git checkout` argument construction paths).

    pnpm (git fetch/checkout argument construction) git argument separator = Insert `--` separator before lockfile-controlled git revision values

Event History

Jun 25, 2026
CVE Published
via MITRE·04:51 PM
Data Sourced
via MITRE·04:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 26, 2026
Advisory Published
via GitHub·10:53 PM
Data Sourced
via GitHub·10:53 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-50014?

The severity of CVE-2026-50014 is medium with a score of 6.4.

2

How do I fix CVE-2026-50014?

To fix CVE-2026-50014, upgrade pnpm to version 10.34.0 or 11.4.0 or later.

3

What type of vulnerability is CVE-2026-50014?

CVE-2026-50014 is an argument injection vulnerability related to git fetch via lockfile resolution in pnpm.

4

What software is affected by CVE-2026-50014?

The software affected by CVE-2026-50014 is pnpm.

5

What is the risk associated with CVE-2026-50014?

CVE-2026-50014 has a risk rating of 48.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203