/

CVE-2026-110634

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in git-diff API Parser

CVE-2026-110634

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

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 critical OS command injection vulnerability in the git-diff API allows shell commands to be executed when attacker-controlled document strings are processed.

The issue becomes risky when an attacker can control content supplied to the diff operation, because command execution may occur with the privileges of the Node.js process.

A critical OS command injection vulnerability in the git-diff API allows shell commands to be executed when attacker-controlled document strings are processed.

The issue becomes risky when an attacker can control content supplied to the diff operation, because command execution may occur with the privileges of the Node.js process.

Affected context

The vulnerability affects applications that use the git-diff API to compare document strings and pass attacker-influenced content into shell command evaluation. It is especially concerning where diff input can be submitted through an exposed service, automated workflow, repository integration, or other untrusted content path.

The vulnerability affects applications that use the git-diff API to compare document strings and pass attacker-influenced content into shell command evaluation. It is especially concerning where diff input can be submitted through an exposed service, automated workflow, repository integration, or other untrusted content path.

Exploit preconditions

  • Attack surface: The git-diff API or an application endpoint that invokes it
  • Required access: Ability to supply or influence a document string being diffed
  • Trigger point: Processing of the crafted string during the diff operation
  • Why exploitation is possible: Shell command evaluation interprets command-substitution syntax within attacker-controlled input
  • Execution context: Commands run with the privileges available to the Node.js process
  • Attack surface: The git-diff API or an application endpoint that invokes it
  • Required access: Ability to supply or influence a document string being diffed
  • Trigger point: Processing of the crafted string during the diff operation
  • Why exploitation is possible: Shell command evaluation interprets command-substitution syntax within attacker-controlled input
  • Execution context: Commands run with the privileges available to the Node.js process

Why this happens

The underlying issue is the unsafe flow of untrusted diff content into a shell execution mechanism. Shell metacharacters and command-substitution constructs are interpreted as executable shell syntax rather than treated solely as document data.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection. The insecure pattern is combining attacker-controlled strings with shell evaluation without eliminating shell interpretation or enforcing a safe, non-shell execution model.

The underlying issue is the unsafe flow of untrusted diff content into a shell execution mechanism. Shell metacharacters and command-substitution constructs are interpreted as executable shell syntax rather than treated solely as document data.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection. The insecure pattern is combining attacker-controlled strings with shell evaluation without eliminating shell interpretation or enforcing a safe, non-shell execution model.

Potential impact

  • Attackers may execute arbitrary operating system commands
  • The application process and its accessible data may be compromised
  • Credentials, tokens, or environment secrets may be exposed
  • Attackers could modify files or alter application behavior
  • Systems reachable from the compromised process may be targeted
  • Integrity of generated diffs and downstream workflows may be affected
  • Attackers may execute arbitrary operating system commands
  • The application process and its accessible data may be compromised
  • Credentials, tokens, or environment secrets may be exposed
  • Attackers could modify files or alter application behavior
  • Systems reachable from the compromised process may be targeted
  • Integrity of generated diffs and downstream workflows may be affected

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from the diff-processing path and reducing trust in input content.

Common defensive patterns include:

  • Use a library or API that performs diff operations without invoking a shell
  • Prefer direct process execution with fixed arguments when an external tool is unavoidable
  • Treat all document and repository content as untrusted input
  • Apply strict input validation based on the expected document format and size
  • Avoid string interpolation when constructing commands
  • Run the Node.js process with least-privilege permissions and restricted filesystem and network access
  • Isolate diff processing from sensitive credentials and high-value workloads

Mitigation generally focuses on removing shell interpretation from the diff-processing path and reducing trust in input content.

Common defensive patterns include:

  • Use a library or API that performs diff operations without invoking a shell
  • Prefer direct process execution with fixed arguments when an external tool is unavoidable
  • Treat all document and repository content as untrusted input
  • Apply strict input validation based on the expected document format and size
  • Avoid string interpolation when constructing commands
  • Run the Node.js process with least-privilege permissions and restricted filesystem and network access
  • Isolate diff processing from sensitive credentials and high-value workloads

How teams detect issues like this

Organizations can look for:

  • Static analysis findings where user-controlled strings reach shell execution APIs
  • Code review signals involving shell command construction, string interpolation, or dynamic command arguments
  • Dependency and API usage policies that prohibit shell evaluation for document-processing operations
  • Runtime monitoring for unexpected child processes, shell invocations, or command activity from the application
  • Tests that verify shell metacharacters remain data and cannot alter process behavior

Automated code review and software composition analysis tools may help identify dangerous execution paths, but manual review is useful for tracing indirect data flows.

Organizations can look for:

  • Static analysis findings where user-controlled strings reach shell execution APIs
  • Code review signals involving shell command construction, string interpolation, or dynamic command arguments
  • Dependency and API usage policies that prohibit shell evaluation for document-processing operations
  • Runtime monitoring for unexpected child processes, shell invocations, or command activity from the application
  • Tests that verify shell metacharacters remain data and cannot alter process behavior

Automated code review and software composition analysis tools may help identify dangerous execution paths, but manual review is useful for tracing indirect data flows.

Sources

SourceLink
github.comgithub.com/danday74/git-diff
github.comgithub.com/danday74/git-diff/blob/a85a649badc4c6bba991e87e82382b7d3cdd6634/js/gitDiffReal/generateDiff/index.js#L26-L30
github.comgithub.com/danday74/git-diff/commit/bfd727b6cf1daa671c3528d1d681f55b70e8fb19
github.comgithub.com/danday74/git-diff/pull/16
vulncheck.comvulncheck.com/advisories/git-diff-before-2.0.7-os-command-injection-via-gitdiff-input-strings

Frequently asked

questions

It can be remotely exploitable when a service exposes the git-diff functionality and accepts attacker-controlled document content. In local-only integrations, exploitation scope depends on who can provide the diff input.

An attacker needs the ability to influence a document string that reaches the vulnerable API. Authentication requirements depend on the application exposing the API and its surrounding access controls.

The safest pattern is to perform diff processing without shell evaluation. If external commands are required, use fixed executable paths and separately validated arguments through a non-shell process interface.

Enforce input trust boundaries, prohibit dynamic shell command construction, run services with least privilege, and use static analysis plus runtime monitoring for unexpected process execution.

It can be remotely exploitable when a service exposes the git-diff functionality and accepts attacker-controlled document content. In local-only integrations, exploitation scope depends on who can provide the diff input.

An attacker needs the ability to influence a document string that reaches the vulnerable API. Authentication requirements depend on the application exposing the API and its surrounding access controls.

The safest pattern is to perform diff processing without shell evaluation. If external commands are required, use fixed executable paths and separately validated arguments through a non-shell process interface.

Enforce input trust boundaries, prohibit dynamic shell command construction, run services with least privilege, and use static analysis plus runtime monitoring for unexpected process execution.

Find out what's already
exploitable in your codebase.