Packages

simple-git 4.1.0: Patching CVE-2026-134815 Argument Injection, Strict Mode, and v4 Upgrade Trade-Offs

With 15.2M weekly npm downloads and 8,659 dependents, simple-git is the backbone of Node.js Git automation. On November 22–23, 2026, CVE-2026-134815 (CVSS 4.0: 9.2 Critical) disclosed an argument injection bypass in versions before 4.1.0—learn how git.cmd, strict mode, and @simple-git/argv-parser 3.0.0 close the gap.

By 0xScorPionSon

7 min read

simple-git 4.1.0: Patching CVE-2026-134815 Argument Injection, Strict Mode, and v4 Upgrade Trade-Offs

simple-git 4.1.0 argument injection guard blocking --exec in listRemote and raw calls

Executive Summary

On November 22–23, 2026, the CVE Program (with VulnCheck acting as CNA) and the European Union Vulnerability Database (EUVD) published CVE-2026-134815 (CVE.org; EUVD), a critical argument injection vulnerability (CWE-88) affecting simple-git prior to version 4.1.0 and its companion parser package @simple-git/argv-parser prior to 3.0.0.

With 15,226,541 weekly npm downloads and 8,659 direct dependent packages verified as of November 24, 2026 (npm), simple-git is one of the most widely deployed Node.js wrappers for automating Git workflows, CI/CD runners, and developer tooling—including AI coding agent sandboxes that clone and inspect repositories.

Key engineering takeaways from this release:

  • Critical Argument Injection Patched (CVSS 4.0: 9.2 / CVSS 3.1: 8.1): Versions before 4.1.0 allowed attackers who influence arguments passed to listRemote() or raw() to bypass the allowUnsafePack guard by supplying --exec to non-push Git commands (ls-remote, archive, fetch-pack, or send-pack), enabling arbitrary host command execution (CVE.org).
  • Modernized v4 Packaging & Breaking Entrypoints: Upgrading from simple-git v3 to 4.1.0 removes the deprecated /promise and default entrypoints, blocks abbreviated Git options, and requires named imports (import { simpleGit } from 'simple-git') (npm).
  • Defense-in-Depth Opt-In (git.cmd & strict): Even on 4.1.0, strict mode and unsafe.recommended remain disabled by default in v4 (scheduled to flip on in v5 and v6), so production teams handling untrusted URLs or branch names must explicitly adopt git.cmd tagged templates and strict: true (npm).

Adoption Telemetry & Version Changelog

simple-git provides a lightweight Promise- and callback-based interface for spawning the system git binary from Node.js applications, managing child-process concurrency (maxConcurrentProcesses, defaulting to 6 in configuration examples) and parsing stdout/stderr into typed TypeScript objects (npm).

As verified on the npm registry on November 24, 2026:

Package Attribute Verified Value (Nov 24, 2026) Source
Latest Version 4.1.0 (published Nov 2026) npm
Companion Security Fix @simple-git/argv-parser@3.0.0 CVE.org
Weekly npm Downloads 15,226,541 npm
Direct npm Dependents 8,659 packages npm
Published Versions 278 npm
Runtime Dependencies 5 (including @kwsites/file-exists and @simple-git/argv-parser) npm
License MIT npm
System Requirement Local git binary in PATH (or via .customBinary()); AbortController requires Node >= 16 npm

Version Milestones Toward 4.1.0

  • v3.33.0 Pathspec Hardening: Updated .clone() and .mirror() so repoPath and localPath are passed as Git pathspec arguments, reducing exposure when unsanitized strings reach clone calls (npm).
  • v4.0.x Modernization: Standardized CommonJS, ESM, and TypeScript consumption, dropped /promise and default entrypoints, blocked abbreviated Git CLI flags, and introduced git.cmd tagged template literals with remoteUrl(), refName(), and pathspec() helpers (npm).
  • v4.1.0 & @simple-git/argv-parser@3.0.0 (Nov 2026): Patched CVE-2026-134815 in commit c8ee6bb4dd0c1259af31da821dc68d74ff5d6f10, closing the --exec bypass in detect-vulnerable-flags.ts (CVE.org).

Security Patches, Breaking Changes & Internals

Root Cause of CVE-2026-134815 (CWE-88)

Because simple-git spawns the native git CLI binary, its primary security boundary relies on @simple-git/argv-parser to inspect argument lists before execution. Prior to 4.1.0, the allowUnsafePack guard (implemented in packages/argv-parser/src/vulnerabilities/detect-vulnerable-flags.ts at line 71 in simple-git@4.0.2) aimed to block dangerous upload/receive-pack execution flags (CVE.org).

However, researcher Zachariah Mithani (AploSec) discovered that an attacker who can influence arguments passed to listRemote() or raw() could supply the --exec option to non-push Git operations—specifically ls-remote, archive, fetch-pack, or send-pack—bypassing the allowUnsafePack check and executing arbitrary OS commands on the host (CVE.org).

Severity Scoring & Exploitation Status

  • CVSS 4.0: 9.2 Critical (CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N) (CVE.org)
  • CVSS 3.1: 8.1 High (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) (CVE.org)
  • Exploitation Status: As of November 23, 2026, active exploitation has not been reported and the vulnerability is not listed in the CISA KEV catalog (isMalicious).

Breaking Changes & Safe git.cmd Usage in v4.1.0

Upgrading from 3.x to 4.1.0 introduces two deliberate breaking shifts alongside the security fix:

  1. Removed Legacy Entrypoints: Imports from simple-git/promise or default imports (import simpleGit from 'simple-git') fail in v4; callers must use named exports (import { simpleGit } from 'simple-git') (npm).
  2. Abbreviated Flags Rejected: Short/abbreviated Git CLI flags are blocked in v4 to prevent option-smuggling ambiguities (npm).

For any workflow that accepts user-supplied repository URLs, branch names, or file paths—such as web webhooks, SaaS repo importers, or AI agent tools—the simple-git documentation explicitly warns against interpolating untrusted data into options objects or raw() arrays, recommending git.cmd with strict: true instead (npm):

import { pathspec, refName, remoteUrl, simpleGit } from 'simple-git';

// Enable strict mode so untrusted config keys and env vars are blocked
const git = simpleGit({
  strict: true,
  allowConfig: ['user.name', 'user.email'],
  allowEnvironment: ['HOME'],
});

// Safe: remoteUrl() restricts protocols; pathspec() prevents flag injection
await git.cmd`clone --depth 1 ${remoteUrl(userRepoUrl, { protocols: ['https'] })} ${pathspec(targetDir)}`;

// Safe: refName() validates branch/tag names; -- separates options from pathspecs
await git.cmd`checkout -b ${refName(branchName)}`;
await git.cmd`ls-remote -- ${remoteUrl(userRepoUrl, { protocols: ['https'] })}`;

If an untrusted value begins with - outside a pathspec() or after --, git.cmd rejects it before spawning git—and remote helper transports (ext::..., fd::...) are always blocked (npm).


Ecosystem Comparison & Upgrade Checklist

Node.js teams automating Git generally choose between wrapping the native git binary (simple-git) and running a pure-JavaScript Git implementation (isomorphic-git). Both are MIT-licensed, but their security and operational trade-offs differ sharply:

Criteria simple-git (v4.1.0) isomorphic-git (v1.43.1 / v1.44.x)
Execution Model Spawns native git child processes (npm) Pure JavaScript reimplementation modifying .git directly (npm)
Weekly npm Downloads 15,226,541 (npm) 1,864,896 (npm)
Direct Dependents 8,659 (npm) 688 (npm)
Runtime Dependencies 5 (npm) 10 (npm)
Browser / Worker Support Node.js only (requires git binary) (npm) Node.js, browsers, WebWorkers, ServiceWorkers (needs CORS proxy for browser remotes) (npm)
Argument Injection Surface Present if untrusted flags reach raw()/listRemote() prior to 4.1.0 (CVE.org) Eliminates OS process-spawning / CLI flag-injection class entirely

Upgrade & Hardening Checklist

  1. Verify Installed Versions: Run npm ls simple-git @simple-git/argv-parser to catch transitive copies inside monorepos and build tools. Confirm simple-git >= 4.1.0 and @simple-git/argv-parser >= 3.0.0 (CVE.org).
  2. Audit listRemote() and raw() Call Sites: Inspect every call to .listRemote() and .raw(). Never pass user-supplied strings into options arrays or objects; migrate dynamic commands to git.cmd tagged templates (npm).
  3. Turn On strict: true or unsafe.recommended: true: Remember that both flags default to false in v4 (before becoming defaults in v5/v6). Enable strict: true on any instance that touches untrusted repositories (npm).
  4. Update v3 Imports: Replace simple-git/promise or default imports with import { simpleGit } from 'simple-git' (or const { simpleGit } = require('simple-git') in CommonJS) (npm).
  5. Pin Lockfiles & Test: Regenerate package-lock.json / pnpm-lock.yaml so @simple-git/argv-parser@3.0.0 is resolved even if a transitive dependency pins ^4.0.0 of simple-git.

Frequently Asked Questions

1. Which versions of simple-git are affected by CVE-2026-134815?

All simple-git versions prior to 4.1.0 and @simple-git/argv-parser versions prior to 3.0.0 are affected (CVE.org).

2. Is my app vulnerable if it only runs hardcoded git.status() or git.pull() calls?

If no untrusted user input ever reaches listRemote(), raw(), or options arrays/objects, an attacker cannot inject --exec through those paths. However, upgrading to 4.1.0 and enabling strict: true is still recommended to close transitive and future exposure (CVE.org; npm).

3. Why didn't allowUnsafePack block --exec before 4.1.0?

The allowUnsafePack guard previously focused on push/pack contexts, leaving --exec usable on non-push operations (ls-remote, archive, fetch-pack, and send-pack) via listRemote() or raw() (CVE.org).

4. Does simple-git 4.1.0 support both CommonJS and ES Modules?

Yes. simple-git v4 supports both require('simple-git') and import { simpleGit } from 'simple-git', along with bundled TypeScript definitions, though the legacy /promise and default entrypoints were removed in v4 (npm).

5. Should I switch from simple-git to isomorphic-git for security?

If your Node.js service only needs basic clone/commit/status operations on untrusted inputs and you want to avoid spawning child git processes altogether, isomorphic-git removes the CLI argument-injection attack surface. If you rely on full native git parity, SSH agent/credential helpers, or high-speed pack operations on large repos, simple-git@4.1.0 with strict: true and git.cmd remains the standard choice (npm; isomorphic-git).


Sources

  1. CVE Program / VulnCheck CNA (Primary): CVE-2026-134815 — simple-git before 4.1.0 Argument Injection via --exec Option in ls-remote — https://www.cve.org/CVERecord?id=CVE-2026-134815 (Published November 22, 2026)
  2. npm Registry (Primary): simple-git v4.1.0 Package Page & Security Documentation — https://www.npmjs.com/package/simple-git (Accessed November 24, 2026)
  3. European Union Vulnerability Database (Primary): EUVD Critical Vulnerabilities Feed (CVE-2026-134815) — https://euvd.enisa.europa.eu/ (November 2026)
  4. npm Registry (Primary): isomorphic-git Package & Dependency Telemetry — https://npmjs.com/package/isomorphic-git (Accessed November 24, 2026)
  5. isMalicious CVE Tracker (Secondary): CVE-2026-134815 Exploitation & CISA KEV Status — https://ismalicious.com/cve/CVE-2026-134815 (November 23, 2026)

More on Packages

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla