GHSA-6wfj-92cw-88vgcritical9.8
git-diff: OS command injection vulnerability via crafted strings to the gitDiff API
The advisory, in context
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.
Affected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
git-diff npm
Semantic versions
Earlier releases before 2.0.7
Fixed in 2.0.7
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.7"
}
],
"type": "SEMVER"
}
],
"versions": []
}References
- https://nvd.nist.gov/vuln/detail/CVE-2026-110634
- https://github.com/danday74/git-diff/pull/16
- https://github.com/danday74/git-diff/commit/bfd727b6cf1daa671c3528d1d681f55b70e8fb19
- https://github.com/danday74/git-diff
- https://github.com/danday74/git-diff/blob/a85a649badc4c6bba991e87e82382b7d3cdd6634/js/gitDiffReal/generateDiff/index.js#L26-L30
- https://www.vulncheck.com/advisories/git-diff-before-2.0.7-os-command-injection-via-gitdiff-input-strings