simple-git Argument Injection RCE, Fixed in 4.1.0 (CVE-2026-134815)
simple-git before 4.1.0 lets attacker-influenced arguments inject git's --exec option and run commands; fixed in 4.1.0.
TL;DR
- simple-git's argument guard blocked the
--execgit option only for thepushtask. Thels-remote,archive,fetch-packandsend-packtasks accept the same option and run a program on the application's host when the remote is a local path or afile://URL. - simple-git before 4.1.0 and
@simple-git/argv-parserbefore 3.0.0 are affected. An application is exposed when untrusted input reacheslistRemote()orraw()as an argument. - VulnCheck rates the flaw CVSS v4.0 9.2 Critical and CVSS v3.1 8.1 High. No public proof of concept and no known in-the-wild exploitation are reported, and the CVE is not in CISA KEV as of 2026-11-23.
- Upgrade to simple-git 4.1.0 or later, which depends on
@simple-git/argv-parser3.0.0. If you cannot upgrade, reject untrusted arguments that begin with a hyphen and never pass request data as git options.
Am I affected?
All of these conditions must hold for an application to be exposed:
- It resolves simple-git 4.0.2 or earlier, or
@simple-git/argv-parser2.0.1 or earlier. - It passes a value influenced by an attacker into
listRemote(),raw()or another API that forwards tokens to git. - That value can begin with
-, and the application does not reject or escape option-shaped input.
An application that builds every git argument from constants is not exposed, even on an affected release. The flaw is in the wrapper's option guard, not in git itself.
simple-git recorded 15,249,076 npm downloads in the week of 2026-11-15 to 2026-11-21, so the parser sits in a large share of Node.js build and automation tooling.
| Branch | Affected versions | Fixed version |
|---|---|---|
| simple-git 4.x | 4.0.0 through 4.0.2, and earlier 4.x | 4.1.0 |
| simple-git 3.x and earlier | All releases before 4.1.0 | 4.1.0 |
| @simple-git/argv-parser 2.x | 2.0.0 and 2.0.1, and earlier 2.x | 3.0.0 |
simple-git 4.1.0 and @simple-git/argv-parser 3.0.0 were published to npm on 2026-11-16. simple-git 4.1.0 is the current release and depends on the fixed parser.
Check the resolved versions in the application:
npm ls simple-git @simple-git/argv-parser
grep -n '"simple-git"\|"@simple-git/argv-parser"' package-lock.json
pnpm why simple-git
yarn why simple-git
npm ls prints the installed tree, including a transitive @simple-git/argv-parser. The GitHub Advisory Database entry for this CVE was not published when checked on 2026-11-23, so npm audit may not report it. Check the resolved version directly.
How do I fix it?
Upgrade simple-git to 4.1.0 or later. The release replaces the parser with @simple-git/argv-parser 3.0.0, so a normal install brings both fixed packages.
- Upgrade the direct dependency:
npm install simple-git@4.1.0
pnpm add simple-git@4.1.0
yarn add simple-git@4.1.0
- Confirm that the parser resolved to 3.0.0:
npm ls @simple-git/argv-parser
- Rebuild and redeploy. A running Node.js process keeps the old module until it restarts, and a container must be rebuilt and recreated, not only pulled.
If the upgrade cannot happen now, remove the injection surface in the application:
- Identify every call to
listRemote(),raw()or another API that forwards a dynamic value to git. - Validate each dynamic value against an allow-list of expected remotes, refs or subcommands.
- Reject any value that begins with
-. Do not try to strip only--exec, because git accepts the unambiguous abbreviations--exand--exe. - Where the git subcommand supports it, put
--before positional values so a value cannot be read as an option. - Do not enable
allowUnsafePackto silence the guard. That option permits the unsafe classes the guard exists to block.
The application-level validation is a stopgap. The supported fix is the upgrade.
What is the root cause?
simple-git passes every token through an argv parser that flags dangerous git options. One of those options is --exec, which names the program that git runs on the remote end of push, send-pack, fetch-pack, archive --remote and ls-remote. The guard that blocked --exec was registered for the push task only.
The vulnerable list is in packages/argv-parser/src/vulnerabilities/detect-vulnerable-flags.ts at tag simple-git@4.0.2:
preventFlagBuilder('push', /^--exec$/, 'allowUnsafePack', { name: '--exec' }),
preventFlagBuilder takes a task name as its first argument. The function it returns checks that name before it inspects the flag:
return function preventFlag(currentTask: string | null, flag: Flag): Vulnerability | void {
if (task && currentTask !== task) {
return;
}
detectVulnerableFlags(task, flags) calls each helper with the task parsed from the argv. For an ls-remote call, the current task is ls-remote, not push, so the helper returns without reporting the flag. The same happens for archive, fetch-pack and send-pack.
The wrapper still reaches git. listRemote(args) prepends ls-remote to the caller's arguments, and raw() passes its tokens through unchanged. A caller that lets an attacker choose a remote, a ref or an options list can therefore deliver --exec=<program> to one of the tasks the guard did not cover.
The guard exists because --exec is in the same risk class as --upload-pack and --receive-pack, which it already blocked for every task. All three name a program that git executes. The task filter left the sibling tasks open.
How is it exploited?
An attacker supplies an option-shaped value where the application expects a remote, a ref or an argument list. When simple-git runs the git command, git treats the value as --exec and runs the named program. For a local path or a file:// remote, that program runs on the application's host.
- The application passes an attacker-influenced value to
listRemote(),raw()or another API that forwards arguments to git. - The attacker supplies
--exec=<program>or--exec <program>as that value. - The argv parser checks the flag against the
allowUnsafePackrule, but the rule only applies topush. - simple-git runs
git ls-remote,git archive,git fetch-packorgit send-packwith the injected option. - git treats the option's value as the remote program and executes it.
- The program runs with the privileges of the Node.js process when the remote is a local path or a
file://URL, because git starts the named program as a local child process. For network remotes, the program runs on the remote host.
The fix's own test cases show the shape, with a harmless touch target:
[['ls-remote', '--exec=touch /tmp/pwn', 'origin']],
[['fetch-pack', '--exec=touch /tmp/pwn', 'origin']],
[['send-pack', '--exec=touch /tmp/pwn', 'origin', 'HEAD']],
[['archive', '--remote=origin', '--exec=touch /tmp/pwn', 'HEAD']],
The test asserts that the parser reports an allowUnsafePack vulnerability for each line. The same file includes a control test that confirms ls-remote --exec executes when allowUnsafePack is enabled.
How does the attack flow?
An option-shaped value reaches the argv parser, passes a guard that only inspected push, and reaches a git task that runs the named program.
listRemote or raw"] --> B["Argv parser checks --exec
only for the push task"] B --> C["ls-remote, archive,
fetch-pack or send-pack passes"] C --> D["git treats the value
as the remote program"] D --> E["Command runs as
the Node.js process user"]
What can an attacker do?
An attacker who controls the value can run a program with the privileges of the process that called simple-git when the remote is a local path or a file:// URL. That process is often a CI runner, a build server, a developer workstation or an application server. For an ssh remote, the program runs on the remote host instead.
- Run commands on the host. The program starts with the account and environment of the Node.js process.
- Read credentials. CI tokens, cloud credentials, SSH keys and repository credentials are reachable when the process can read them.
- Modify repositories and build outputs. The process usually has write access to the checkout it is operating on.
- Move to other systems. The host's network position and the stolen credentials decide how far the attacker can go.
CI runners are the most valuable target. They hold deployment credentials, cloud tokens and repository write access, and a pull-request build often runs on code an outside contributor supplied. An ephemeral runner limits how long an implant survives, but it does not limit what the attacker reads during the job. A self-hosted runner or a workstation keeps the compromise after the build ends.
Every condition is listed here. The application must use an affected release. It must pass attacker-influenced input to an argument-forwarding API. The value must be able to begin with a hyphen. No authentication is needed when a public input, such as a repository URL from a web form, reaches the call. A CI job that clones a repository named by an outside contributor is a typical case, because the remote URL is attacker-influenced.
Why does the fix work?
The fix makes the --exec rule apply to every git task except rebase, and it keeps the rebase form under its own option. It also adds tests for every affected task and for the --exec=value and --exec value forms.
- preventFlagBuilder('push', /^--exec$/, 'allowUnsafePack', { name: '--exec' }),
+ // `--exec` names the program run on the remote end of `push`, `send-pack`, `fetch-pack`, `archive` and
+ // (undocumented) `ls-remote`, `rebase` uses it for a command run after each commit
+ preventFlagBuilder(null, /^--exec$/, 'allowUnsafePack', {
+ name: '--exec',
+ exceptTask: 'rebase',
+ }),
Passing null as the task removes the task-equality check, so the rule now inspects --exec for every task. The new exceptTask check skips rebase, where --exec runs a command after each commit and is covered by the separate allowUnsafeExec option. A rebase --exec call therefore still requires its own opt-in, and it is not conflated with the remote-program use.
The fix covers the four tasks named in the CVE and the abbreviation handling that git applies to long options. A caller that deliberately enables allowUnsafePack keeps the old behavior, because that option exists to permit these classes.
The same 4.1.0 release closes a broader set of related argument and configuration injection reports. It blocks git config --rename-section, sendemail.* command keys, instaweb.* server keys, browser.*.cmd, interactive.diffFilter and the filter-branch shell options. Those reports have no separate CVE in the record, so the safe target is the whole release.
How do I check if I was compromised?
No indicators of compromise are published for CVE-2026-134815. The injected program can be a single command, and a failed attempt may leave no trace in the application.
Start with the process and CI logs, looking for git command lines that carry --exec or its abbreviations:
grep -RniE -- '--ex(e(c)?)?([= ]|$)' /var/log/ci /var/log/jenkins 2>/dev/null
Check for git child processes that do not match the application's normal operations:
ps -eo pid,ppid,user,args | grep -E '[g]it (ls-remote|archive|fetch-pack|send-pack)'
On a host with process accounting or auditd, search for short-lived processes started by the Node.js process:
ausearch -m execve -ts recent 2>/dev/null | grep -E 'node|git|exec'
A hit is a lead, not proof. The injected program can be named anything, and the --exec token may be logged only in the git process arguments. If a build machine ran a job whose remote URL came from an outside party, review that job's secrets and rotate them if the process had access.
Timeline
- 2026-11-09: The fix commit
c8ee6bb4dd0cwas authored in the simple-git repository. - 2026-11-16: simple-git 4.1.0 and
@simple-git/argv-parser3.0.0 were published to npm. - 2026-11-22: VulnCheck published CVE-2026-134815.
FAQ
Does this vulnerability affect git itself?
No. git's --exec option is documented behavior. The flaw is in simple-git's guard, which was meant to stop callers from passing the option when they accept untrusted input.
Is listRemote() the only entry point?
No. The CVE names listRemote() and raw(). Any simple-git API that forwards a caller-supplied token to git can deliver the option when the application lets an attacker shape that token.
Is there a public exploit?
No public proof of concept is published, and no in-the-wild exploitation is reported as of 2026-11-23. The fix commit's tests use a harmless touch command and are not a weaponized exploit.
Is the guard on by default?
Yes. simple-git reports the allowUnsafePack violation and throws unless the caller explicitly enables the unsafe option. The flaw was that the --exec rule did not run for four tasks, not that the guard was disabled.
Does npm audit report CVE-2026-134815?
Not when checked on 2026-11-23, because the GitHub Advisory Database entry was not published. Check npm ls simple-git and the lockfile instead, and upgrade to 4.1.0 or later.
Which version should I install?
simple-git 4.1.0, which is the current release, with @simple-git/argv-parser 3.0.0. Any later release that keeps the fixed parser is also safe.
References
- CVE-2026-134815 record, published 2026-11-22 (checked November 23, 2026): https://www.cve.org/CVERecord?id=CVE-2026-134815
- VulnCheck advisory for simple-git before 4.1.0, published 2026-11-22 (checked November 23, 2026): https://www.vulncheck.com/advisories/simple-git-before-4.1.0-argument-injection-via-exec-option-in-ls-remote
- Fix commit c8ee6bb4dd0c, "Add tests for report rejections and resolve GHSA issues", authored 2026-11-09 (checked November 23, 2026): https://github.com/steveukx/git-js/commit/c8ee6bb4dd0c1259af31da821dc68d74ff5d6f10
- simple-git 4.1.0 release, published 2026-11-16 (checked November 23, 2026): https://github.com/steveukx/git-js/releases/tag/simple-git%404.1.0
- @simple-git/argv-parser 3.0.0 release, published 2026-11-16 (checked November 23, 2026): https://github.com/steveukx/git-js/releases/tag/%40simple-git%2Fargv-parser%403.0.0
- Vulnerable flag guard at tag simple-git@4.0.2 (checked November 23, 2026): https://github.com/steveukx/git-js/blob/simple-git%404.0.2/packages/argv-parser/src/vulnerabilities/detect-vulnerable-flags.ts
- Fixed flag guard at tag simple-git@4.1.0 (checked November 23, 2026): https://github.com/steveukx/git-js/blob/simple-git%404.1.0/packages/argv-parser/src/vulnerabilities/detect-vulnerable-flags.ts
- simple-git unsafe-actions documentation (checked November 23, 2026): https://github.com/steveukx/git-js/blob/simple-git%404.1.0/docs/PLUGIN-UNSAFE-ACTIONS.md
- npm weekly downloads for simple-git, week of 2026-11-15 to 2026-11-21 (checked November 23, 2026): https://www.npmjs.com/package/simple-git
- CWE-88, Improper Neutralization of Argument Delimiters in a Command (checked November 23, 2026): https://cwe.mitre.org/data/definitions/88.html
- CISA Known Exploited Vulnerabilities catalog, checked for CVE-2026-134815 on 2026-11-23: https://www.cisa.gov/known-exploited-vulnerabilities-catalog