Skip to main content
Vulnerability Database/CVE-2026-102826

CVE-2026-102826: simple-git RCE Vulnerability

CVE-2026-102826 is a remote code execution flaw in simple-git that allows attackers to execute arbitrary commands through malicious Git configuration files. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-102826 Overview

CVE-2026-102826 is a command injection vulnerability [CWE-77] in simple-git, a widely used Node.js interface for executing Git commands. Versions prior to 4.0.0 ship a default blockUnsafeOperationsPlugin that fails to fully reject configuration includes passed through customArgs to git.clone(). Attackers can supply include.path or includeIf.<condition>.path values that force Git to load an attacker-controlled configuration file. That configuration can define executable options such as core.sshCommand, which Git invokes during the clone with the privileges of the Node.js process.

Critical Impact

Successful exploitation yields arbitrary command execution under the Node.js process account, enabling full compromise of the host application context.

Affected Products

  • simple-git npm package, all versions prior to 4.0.0
  • Node.js applications invoking git.clone() with user-influenced customArgs
  • Downstream CI/CD, developer tooling, and web services embedding simple-git

Discovery Timeline

  • 2026-09-29 - CVE CVE-2026-102826 published to NVD
  • 2026-09-29 - Last updated in NVD database

Technical Details for CVE-2026-102826

Vulnerability Analysis

The flaw lives in the plugin responsible for blocking unsafe Git options passed via user-controlled arguments. The initial safeguard classified some, but not all, include directives as unsafe. Git supports -c include.path=<file> and the conditional -c includeIf.<condition>.path=<file> forms, both of which instruct Git to load and merge an external configuration file. When the plugin failed to classify these keys, callers of git.clone() could inject them through customArgs.

Once loaded, the external configuration can set executable options. The most consequential is core.sshCommand, which Git executes when contacting remote repositories over SSH. Because Git runs this command as a child process of the Node.js runtime, the attacker inherits the privileges of the host application. Exploitation requires the attacker to influence the argument array and to place a readable file on the target system.

Root Cause

The root cause is an incomplete deny-list in the blockUnsafeOperationsPlugin. The plugin did not treat include.path and includeIf.<condition>.path as configuration-loading primitives. This allowed an argument-level filter bypass that enabled loading of arbitrary Git configuration during clone operations.

Attack Vector

An attacker who controls or influences the customArgs array passed to git.clone() supplies a -c include.path=/path/to/evil or -c includeIf.<cond>.path=/path/to/evil argument. The referenced file must be reachable by the Node.js process. That file defines core.sshCommand (or another executable option) whose value Git spawns during the clone, resulting in command execution.

See the GitHub Security Advisory GHSA-g4wm-2vf7-vfgr and the pull request discussion for the full technical breakdown.

text
# Illustrative attacker-influenced arguments passed to git.clone()
# (Conceptual — see the upstream advisory for full detail)
customArgs: [
  '-c', 'include.path=/tmp/attacker.gitconfig',
  '-c', 'includeIf.hasconfig:remote.*.url:**/**.path=/tmp/attacker.gitconfig'
]

# /tmp/attacker.gitconfig
[core]
    sshCommand = "sh -c 'id > /tmp/pwn'"

Source: GitHub Security Advisory GHSA-g4wm-2vf7-vfgr

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-102826

Indicators of Compromise

  • Git child processes spawned by Node.js runtimes with arguments containing include.path= or includeIf. substrings.
  • Unexpected shell interpreters (sh, bash, cmd.exe) launched as descendants of a git clone invocation.
  • New or modified .gitconfig-style files in world-writable or application-writable directories preceding a clone operation.
  • Outbound network connections initiated by processes that Git spawned via core.sshCommand.

Detection Strategies

  • Inspect process command lines for -c include.path and -c includeIf tokens under node parents.
  • Correlate git clone events with subsequent process creation events whose image path is not git-remote-* or ssh.
  • Alert on file reads of Git configuration files located outside the repository, home directory, or system config paths.

Monitoring Recommendations

  • Enable process-lineage telemetry on build agents, CI/CD runners, and application servers that use simple-git.
  • Review dependency manifests (package.json, package-lock.json) for simple-git versions below 4.0.0 and flag them for remediation.
  • Capture and retain command-line arguments for all git executions to support retroactive hunting.

How to Mitigate CVE-2026-102826

Immediate Actions Required

  • Upgrade simple-git to version 4.0.0 or later across all applications and container images.
  • Audit code paths that build customArgs for git.clone() and reject any user-supplied values.
  • Rotate credentials and SSH keys used by services running vulnerable versions if attacker access is suspected.

Patch Information

The issue is resolved in simple-git@4.0.0. The remediation, tracked in the merged pull request and upstream commit, extends the unsafe-argument classifier to reject both include.path and includeIf.<condition>.path variants passed through customArgs.

Workarounds

  • Do not pass user-controlled input into customArgs, customBinary, or any argument-building API of simple-git.
  • Run applications that clone untrusted repositories under a least-privilege service account with no sensitive credentials mounted.
  • Restrict the Node.js process file system view (for example via containers or chroot) so that attacker-writable directories cannot be referenced by include paths.
bash
# Upgrade simple-git to the fixed release
npm install simple-git@^4.0.0

# Verify the installed version
npm ls simple-git

# Audit for the vulnerable package across a monorepo
npm ls simple-git --all | grep -E 'simple-git@([0-3]\.|4\.0\.0-)'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.