/

CVE-2026-102828

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in simple-git Trailers

CVE-2026-102828

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78, CWE-184

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A command-injection vulnerability in simple-git can cause Git to execute an attacker-selected shell command when configured trailer values are processed by git interpret-trailers.

The risk arises when an application passes attacker-controlled data through SimpleGitOptions.config or inline Git -c arguments, allowing code execution with the permissions of the Node.js process.

A command-injection vulnerability in simple-git can cause Git to execute an attacker-selected shell command when configured trailer values are processed by git interpret-trailers.

The risk arises when an application passes attacker-controlled data through SimpleGitOptions.config or inline Git -c arguments, allowing code execution with the permissions of the Node.js process.

Affected context

The vulnerability affects simple-git applications in the impacted release range when they expose Git configuration to attacker-controlled input. The default blockUnsafeOperationsPlugin does not classify trailer.<token>.cmd as unsafe, so a configured trailer command may be accepted and later invoked while Git processes trailer metadata.

The vulnerability affects simple-git applications in the impacted release range when they expose Git configuration to attacker-controlled input. The default blockUnsafeOperationsPlugin does not classify trailer.<token>.cmd as unsafe, so a configured trailer command may be accepted and later invoked while Git processes trailer metadata.

Exploit preconditions

  • Attack surface: Node.js application code that invokes simple-git and forwards Git configuration or inline -c arguments
  • Required access: Ability to influence a configuration value, trailer definition, or other input that reaches the Git command invocation
  • Trigger point: Processing of configured trailers through git interpret-trailers
  • Why exploitation is possible: The unsafe trailer.<token>.cmd configuration is not blocked, allowing Git to interpret attacker-controlled configuration as a shell command
  • Attack surface: Node.js application code that invokes simple-git and forwards Git configuration or inline -c arguments
  • Required access: Ability to influence a configuration value, trailer definition, or other input that reaches the Git command invocation
  • Trigger point: Processing of configured trailers through git interpret-trailers
  • Why exploitation is possible: The unsafe trailer.<token>.cmd configuration is not blocked, allowing Git to interpret attacker-controlled configuration as a shell command

Why this happens

The underlying flaw is incomplete validation of Git configuration keys in the default unsafe-operation filtering logic. Because trailer.<token>.cmd is not recognized as a dangerous command-bearing option, untrusted values can reach Git's trailer-processing functionality, which may invoke them as shell commands.

This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with CWE-184: Incomplete List of Disallowed Inputs describing the omission in the safety filter.

The underlying flaw is incomplete validation of Git configuration keys in the default unsafe-operation filtering logic. Because trailer.<token>.cmd is not recognized as a dangerous command-bearing option, untrusted values can reach Git's trailer-processing functionality, which may invoke them as shell commands.

This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with CWE-184: Incomplete List of Disallowed Inputs describing the omission in the safety filter.

Potential impact

  • An attacker may execute arbitrary operating-system commands
  • The Node.js process may be compromised with its current identity and permissions
  • Application secrets, source code, or Git credentials could be accessed
  • Data may be modified, deleted, or poisoned
  • The compromised process could be used for lateral movement where network and service permissions allow
  • An attacker may execute arbitrary operating-system commands
  • The Node.js process may be compromised with its current identity and permissions
  • Application secrets, source code, or Git credentials could be accessed
  • Data may be modified, deleted, or poisoned
  • The compromised process could be used for lateral movement where network and service permissions allow

General mitigation guidance

Mitigation centers on preventing untrusted data from becoming Git configuration or command arguments.

Common defensive patterns include:

  • Rejecting or allowlisting Git configuration keys, including command-bearing trailer settings
  • Avoiding dynamic inline -c arguments when values originate outside a trusted control plane
  • Treating repository metadata, commit messages, and trailer input as untrusted
  • Separating user-controlled values from process-spawning APIs and using structured interfaces where available
  • Running Node.js services with least-privilege operating-system identities and restricted filesystem and network access
  • Applying defense-in-depth controls such as sandboxing and credential isolation

Mitigation centers on preventing untrusted data from becoming Git configuration or command arguments.

Common defensive patterns include:

  • Rejecting or allowlisting Git configuration keys, including command-bearing trailer settings
  • Avoiding dynamic inline -c arguments when values originate outside a trusted control plane
  • Treating repository metadata, commit messages, and trailer input as untrusted
  • Separating user-controlled values from process-spawning APIs and using structured interfaces where available
  • Running Node.js services with least-privilege operating-system identities and restricted filesystem and network access
  • Applying defense-in-depth controls such as sandboxing and credential isolation

How teams detect issues like this

Detection approaches can include:

  • Static analysis for attacker-controlled data flowing into SimpleGitOptions.config, inline -c arguments, or Git process-spawning APIs
  • Code review checks for dynamic construction of Git configuration keys and trailer definitions
  • Policy rules that reject trailer.*.cmd and other command-bearing Git options unless explicitly approved
  • Runtime monitoring for unexpected git interpret-trailers executions or child processes spawned by Node.js services
  • Automated dependency and security review tools that identify unsafe command-invocation patterns

Detection approaches can include:

  • Static analysis for attacker-controlled data flowing into SimpleGitOptions.config, inline -c arguments, or Git process-spawning APIs
  • Code review checks for dynamic construction of Git configuration keys and trailer definitions
  • Policy rules that reject trailer.*.cmd and other command-bearing Git options unless explicitly approved
  • Runtime monitoring for unexpected git interpret-trailers executions or child processes spawned by Node.js services
  • Automated dependency and security review tools that identify unsafe command-invocation patterns

Sources

SourceLink
github.comgithub.com/steveukx/git-js/commit/d762810c13b331ff1e5eb24c0b434646d2a8d1b3
github.comgithub.com/steveukx/git-js/pull/1198
github.comgithub.com/steveukx/git-js/releases/tag/simple-git@4.0.1
github.comgithub.com/steveukx/git-js/security/advisories/GHSA-x6jw-m9v5-85vh

Frequently asked

questions

It can be exploitable through a remotely reachable application when that application forwards attacker-controlled configuration or inline Git arguments to simple-git. The vulnerability is not inherently exploitable without such an input path.

The attacker needs a way to influence Git configuration, trailer-related values, or another application input that is incorporated into the Git command invocation.

Do not pass untrusted values into Git configuration or command arguments. Enforce strict allowlists for permitted options and reject command-bearing trailer configuration.

Treat all Git options and repository metadata as untrusted, test denylist and allowlist behavior for dangerous configuration keys, apply least privilege to the Node.js process, and monitor unexpected child-process execution.

It can be exploitable through a remotely reachable application when that application forwards attacker-controlled configuration or inline Git arguments to simple-git. The vulnerability is not inherently exploitable without such an input path.

The attacker needs a way to influence Git configuration, trailer-related values, or another application input that is incorporated into the Git command invocation.

Do not pass untrusted values into Git configuration or command arguments. Enforce strict allowlists for permitted options and reject command-bearing trailer configuration.

Treat all Git options and repository metadata as untrusted, test denylist and allowlist behavior for dangerous configuration keys, apply least privilege to the Node.js process, and monitor unexpected child-process execution.

Find out what's already
exploitable in your codebase.