Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted string to gitDiff API
-
ExploitEmbed $(cmd) or backtick substitution
-
Executionshelljs.exec evaluates payload in shell
-
ImpactExecute arbitrary OS commands as Node.js process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an application that passes attacker-controllable document strings into git-diff's gitDiff API (versions before 2.0.7, which hash inputs via a shell |
| Impact | The CVSS 4.0 base score of 9.3 (Critical) reflects a maximal-impact OS command injection: network vector, low complexity, no privileges, no user interaction, with high confidentiality, integrity and availability impact to the vulnerable system (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H). However, this is a design-level caveat rather than a universally remote bug: git-diff is a library, and the 'network/unauthenticated' characterization only holds when the consuming application forwards attacker-controlled document strings into the gitDiff API. Where the diffed strings are internal/trusted, real exposure drops sharply. No EPSS score and no KEV status were provided in the input, so exploitation probability and active-exploitation signals cannot be assessed - their absence is not evidence of low risk, but it means there is no public-exploitation data point to corroborate the high CVSS. No public exploit code was identified; the only public artifact is the vendor fix (PR #16 / commit bfd727b) which clearly reveals the vulnerable shell-interpolation pattern and thus lowers the effort to weaponize. Net assessment: a genuinely high-severity, easily-understood injection flaw, but real-world priority is gated by how widely the small git-diff package is deployed and whether applications expose its input to untrusted data - treat as high priority for any service that diffs user-supplied content, lower for internal tooling. |
| Exploit ScenarioDerived | An application that diffs user-submitted documents calls git-diff's gitDiff API with an attacker-controlled string such as 'hello $(id > /tmp/pwned)'. Because the pre-2.0.7 code interpolates the string into a |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
OS command injection in the npm package git-diff (danday74/git-diff) before 2.0.7 lets unauthenticated attackers execute arbitrary shell commands with the privileges of the Node.js process by passing crafted document strings into the gitDiff API. The library hashed each input with a shell command of the form printf "..." | git hash-object -w --stdin evaluated through shelljs.exec, so payloads containing $(cmd) or backtick substitutions survived the JSON.stringify escaping and were executed. The vendor has published an upstream fix that removes the shell invocation entirely, and no public exploit code has been identified at time of analysis; the assessed CVSS 4.0 base score is 9.3 (Critical) for maximal confidentiality, integrity and availability impact to the vulnerable system.
RemediationAI
Upgrade git-diff to 2.0.7 or later, which the advisory identifies as the first non-vulnerable release; if a tagged 2.0.7 artifact is not yet available in your registry mirror, apply the upstream fix directly - the change is in https://github.com/danday74/git-diff/pull/16 with the exact patch commit at https://github.com/danday74/git-diff/commit/bfd727b6cf1daa671c3528d1d681f55b70e8fb19, and it swaps shelljs.exec for child_process.execFileSync with the untrusted strings passed via stdin so no shell is involved. Note the caveat that the patch references are a GitHub PR/commit, so confirm the published package version you install actually contains it before considering the issue closed. If you cannot upgrade immediately, stop passing untrusted or externally sourced content into the gitDiff API at all - this is the only fully reliable workaround, since input filters that strip $(...) and backticks are trivially bypassable with encoding or alternate substitution forms and will also corrupt legitimate diff content. As a compensating control, run the Node.js process that performs diffs under a restricted, unprivileged account with a read-only container filesystem and no network egress, and drop spawn/exec capability from its seccomp or AppArmor profile; the trade-off is that these controls limit blast radius but do not remove the injection itself.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
git-diff is a Node.js library that produces a git-style diff between two strings. In versions before 2.0.7 the internal generateDiff routine built two shell command strings by JSON.stringify-ing the caller-supplied strings and interpolating them into printf <json> | git <gitDir> hash-object -w --stdin, which was then run with shelljs.exec. JSON.stringify only escapes quotes and backslashes, so shell command-substitution syntax such as $(cmd) or cmd remained intact inside the double quotes and was interpreted by the shell before git ever received the input. That is a classic CWE-78 OS Command Injection: untrusted data crossing into a shell interpreter without escaping or parameterization. Because the commands are executed as children of the Node.js process, the attacker inherits that process's user, environment and filesystem access. The upstream fix in PR #16 replaces the shell pipeline with child_process.execFileSync('git', ['--git-dir', gitDir, 'hash-object', '-w', '--stdin'], {input: input}), feeding the untrusted value over the child's stdin so no shell parsing occurs; the patch also notes the previous implementation deliberately avoided .. history expansion but did nothing to neutralize command substitution. The affected component is identified by CPE cpe:2.3:a:danday74:git-diff:*:*:*:*:*:*:*:* (all versions before 2.0.7).
Know when Node.js gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Attacker-controlled input to the API yields shell command execution with no auth or interaction (AV:N/AC:L/PR:N/UI:N); code runs within the Node process so S:U; full C/I/A impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
git-diff before 2.0.7 contains an OS command injection vulnerability that allows attackers to execute shell commands by supplying crafted strings to the gitDiff API. Attackers who control a diffed document string can embed $(cmd) or backtick substitutions that shelljs.exec evaluates, running commands with Node.js process privileges.
Articles & Coverage 1
Executive ViewAI
A critical OS command injection flaw in the npm package git-diff (danday74/git-diff) before 2.0.7 allows attackers to execute arbitrary shell commands with the privileges of the Node.js process wherever the library is used. Organizations using affected versions in development, CI/CD, or production applications face potential data exposure, service disruption, and full system compromise, making remediation a leadership priority. No public exploit identified at time of analysis, but the vendor has released a fixed version (2.0.7) that removes the vulnerable shell invocation.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
EUVD-2026-101262
GHSA-6wfj-92cw-88vg
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB