Arbitrary Argument Injection Affecting cross-spawn package, versions >=6.0.6 <6.0.7>=7.0.4 <7.1.0


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.56% (49th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-CROSSSPAWN-23184495
  • published1 Dec 2026
  • disclosed30 Nov 2026
  • creditDuong Bui Thai, trackoor, ogffx

Introduced: 30 Nov 2026

NewCVE-2026-137198  (opens in a new tab)
CWE-88  (opens in a new tab)

How to fix?

Upgrade cross-spawn to version 6.0.7, 7.1.0 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Argument Injection via incorrect backslash doubling in the argument-escaping logic in lib/util/escape.js when spawning commands routed through cmd.exe on Windows. Two or more backslashes preceding a double quote, or appearing at the end of an argument, are not correctly doubled, allowing the argument's closing quote to be escaped. This lets attacker-controlled text split into extra arguments or consume following arguments, enabling an attacker who controls argument values to alter the target program's behavior, for example injecting flags such as --write into a command invoked with --check.

Note: This is only exploitable on Windows when untrusted input is passed as arguments to a command routed through cmd.exe, including npm cmd-shims in node_modules/.bin.

Workaround

Validate untrusted input so that only a safe subset of characters and patterns is allowed before passing it as arguments.

CVSS Base Scores

version 4.0
version 3.1