---
id: "CVE-2026-110634"
kind: "vulnerability"
aliases: ["CVE-2026-110634", "GHSA-6wfj-92cw-88vg"]
title: "git-diff: OS command injection vulnerability via crafted strings to the gitDiff API"
severity: "critical"
cvss: 9.8
epss: 0.02348
exploited: false
status: "open"
category: "package"
products: [{"name": "git-diff", "fixed": ["2.0.7"], "affected": "< 2.0.7", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-78", "git-diff", "node.js", "npm", "package"]
not_affected_if: ["no-untrusted-input", "package-not-installed", "version-2.0.7-or-later"]
published_at: "2026-10-14T15:17:16+00:00"
first_seen_at: "2026-10-27T16:10:07+00:00"
updated_at: "2026-10-27T16:33:08+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-6wfj-92cw-88vg", "first_seen_at": "2026-10-27T16:10:07+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-110634", "first_seen_at": "2026-10-27T16:33:08+00:00"}]
---

# git-diff: OS command injection vulnerability via crafted strings to the gitDiff API

The npm package git-diff before 2.0.7 passes input strings to a shell through shelljs.exec without escaping them. An attacker who controls a diffed string can embed $(cmd) or backtick substitutions and run commands with the Node.js process privileges.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:git-diff affected < 2.0.7 fixed 2.0.7

## How to check

- Run `npm ls git-diff` in each project to see whether the package is installed and which version resolves.
- Check `package-lock.json` or `yarn.lock` for `git-diff` entries below `2.0.7`.
- Search code for calls to `gitDiff` where the input can come from users or external documents.

## Fix

- Upgrade `git-diff` to `2.0.7` or later.
- Until upgraded, do not pass untrusted user or document strings into `gitDiff`.

## Timeline

- 2026-10-27T16:10:07+00:00 ghsa https://github.com/advisories/GHSA-6wfj-92cw-88vg
- 2026-10-27T16:33:08+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-110634

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
