CVE-2026-137199: cross-spawn: Command injection on Windows when spawning batch files
Published 2026-12-01 · Updated 2026-12-01 · Also known as GHSA-ghv9-86vm-4v8m
Summary
The cross-spawn package contains a command injection vulnerability on Windows when spawning batch files due to improper argument escaping. Developers using affected versions of cross-spawn on Windows systems should update to the patched releases immediately.
Who is affected
The vulnerability affects applications passing untrusted input as arguments to commands processed through cmd.exe, such as .bat or .cmd files. Successful exploitation allows an attacker to break out of command quotes and execute arbitrary commands, potentially leading to full system compromise. Non-Windows platforms and implementations using options.shell are not affected.
Exploitability
The vulnerability is considered critical but requires specific conditions, including an attack surface where untrusted input is passed to cross-spawn on Windows. The CVSS 4.0 vector indicates high impacts for confidentiality, integrity, and availability, though EPSS data is not yet available and the vulnerability is not listed in CISA KEV.
Remediation
- Upgrade cross-spawn to version 7.1.0 or 6.0.7.
- Validate all untrusted input to ensure it conforms to a safe subset of allowed characters.
- Call executables directly rather than routing commands through batch files.
How to check your project
- Check package.json or the project's lock file (package-lock.json, yarn.lock) to confirm if cross-spawn version 7.x is between 7.0.0 and 7.0.x, or if version 0 to 6.0.6 is in use.
Automated analysis of the published advisory data, generated 2026-12-01. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| npm | cross-spawn |
>= 7.0.0, < 7.1.0 | 7.1.0 | npm install [email protected] |
| npm | cross-spawn |
>= 0, < 6.0.7 | 6.0.7 | npm install [email protected] |
CVSS 4.0 vector
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
| Attack vector | Network |
|---|---|
| Attack complexity | High |
| Attack requirements | Present |
| Privileges required | None |
| User interaction | None |
| Confidentiality (vulnerable system) | High |
| Integrity (vulnerable system) | High |
| Availability (vulnerable system) | High |
| Confidentiality (subsequent systems) | None |
| Integrity (subsequent systems) | None |
| Availability (subsequent systems) | None |
Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.
FAQ
Is this vulnerability exploitable on Linux or macOS?
No, the vulnerability is specific to the Windows command parsing behavior when using cmd.exe.
Does setting options.shell mitigate this issue?
Yes, using options.shell is not affected as it does not perform the problematic command or argument escaping.
Are there scenarios where patching is insufficient?
Yes, batch files that use unquoted arguments such as %~1 cannot be fully protected by escaping; in these cases, you must change how the batch file handles arguments.
Original advisory description
References
- WEB https://github.com/moxystudio/node-cross-spawn/security/advisories/GHSA-ghv9-86vm-4v8m
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-137199
- WEB https://github.com/moxystudio/node-cross-spawn/issues/171
- WEB https://github.com/moxystudio/node-cross-spawn/pull/191
- WEB https://github.com/moxystudio/node-cross-spawn/pull/192
- WEB https://github.com/moxystudio/node-cross-spawn/commit/1b71aa519a2e4f97d1f3ee27f0e2fc24ba17cf1a
- WEB https://github.com/moxystudio/node-cross-spawn/commit/244ffeaa8473de0080c93ebbf779bb953b94114b
- PACKAGE https://github.com/moxystudio/node-cross-spawn
- WEB https://github.com/moxystudio/node-cross-spawn/releases/tag/v6.0.7
- WEB https://github.com/moxystudio/node-cross-spawn/releases/tag/v7.1.0
Source records: GHSA-ghv9-86vm-4v8m (OSV.dev).