Command injection in cross-spawn on Windows when spawning batch files
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-78.
Summary
cross-spawn versions from 7.0.0 before 7.1.0 and before 6.0.7 on Windows can run commands when untrusted arguments are passed to commands routed through cmd.exe. The flaw is an improper neutralization of special elements used in an OS command (CWE-78), because cross-spawn did not account for the second cmd.exe parse when a batch file forwards its arguments. An attacker who controls an argument can break out of its quotes and execute arbitrary commands through npm.cmd, global package shims, or user batch files. Other platforms and the options.shell mode are not affected.
Written with Claude Haiku 5.5 from the sources below · 2026-12-01
Description from the CNA
cross-spawn is a cross-platform solution for Node.js spawn and spawnSync. Prior to 6.0.7 and 7.1.0, Windows applications that pass untrusted arguments to commands routed through cmd.exe can be vulnerable because cross-spawn did not account for the second cmd.exe parse performed when a batch file outside node_modules/.bin forwards its arguments. A crafted argument could break out of its quotes and execute arbitrary commands through npm.cmd, globally installed package shims, or user batch files. Trailing dots or spaces could bypass batch-file detection. A percent-delimited variable in an argument could be expanded when an environment variable with the same name followed by a caret existed, and an exclamation-delimited variable could be expanded when delayed expansion was enabled in the registry. Other platforms and the intentionally unescaped options.shell mode are not affected. This issue is fixed in versions 6.0.7 and 7.1.0.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| moxystudio | node-cross-spawn | before 6.0.7; 7.0.0 to before 7.1.0 | 6.0.7, 7.1.0 | Patch available | CNA |
| — | cross-spawn (npm) | 7.0.0 to before 7.1.0 | 7.1.0 | Patch available | GHSA-ghv9-86vm-4v8m |
| — | cross-spawn (npm) | before 6.0.7 | 6.0.7 | Patch available | GHSA-ghv9-86vm-4v8m |
- node-cross-spawn Vendormoxystudio Affected before 6.0.7; 7.0.0 to before 7.1.0 Fixed in 6.0.7, 7.1.0 Patch available CNA
- cross-spawn (npm) Vendor— Affected 7.0.0 to before 7.1.0 Fixed in 7.1.0 Patch available GHSA-ghv9-86vm-4v8m
- cross-spawn (npm) Vendor— Affected before 6.0.7 Fixed in 6.0.7 Patch available GHSA-ghv9-86vm-4v8m
Remediation
Update cross-spawn to version 6.0.7 for the 6.x line and to version 7.1.0 for the 7.x line. The sources list no fixed version for the other packages affected by this flaw.
Written with Claude Haiku 5.5 from the sources below · 2026-12-01
- Fix · CNA node-cross-spawn (moxystudio) Fixed in 6.0.7, 7.1.0
- Fix · GHSA-ghv9-86vm-4v8m cross-spawn (npm) Fixed in 7.1.0 Advisory →
- Fix · GHSA-ghv9-86vm-4v8m cross-spawn (npm) Fixed in 6.0.7 Advisory →
Timeline
- 2026-11-30 Threatist record created from CVE-2026-137199
- 2026-12-01 Alias added: GHSA-ghv9-86vm-4v8m
- 2026-12-01 Fix available: npm/[email protected], npm/[email protected] · GHSA-ghv9-86vm-4v8m
- 2026-12-01 CVSS score added · GHSA-ghv9-86vm-4v8m
- 2026-12-01 Weakness changed · GHSA-ghv9-86vm-4v8m
- 2026-12-01 10 new references · GHSA-ghv9-86vm-4v8m
References
Other 9
- https://github.com/moxystudio/node-cross-spawn/security/advisories/GHSA-ghv9-86vm-4v8m
- https://github.com/moxystudio/node-cross-spawn/issues/171
- https://github.com/moxystudio/node-cross-spawn/pull/191
- https://github.com/moxystudio/node-cross-spawn/pull/192
- https://github.com/moxystudio/node-cross-spawn/commit/1b71aa519a2e4f97d1f3ee27f0e2fc24ba17cf1a
- https://github.com/moxystudio/node-cross-spawn/commit/244ffeaa8473de0080c93ebbf779bb953b94114b
- https://github.com/moxystudio/node-cross-spawn/releases/tag/v6.0.7
- https://github.com/moxystudio/node-cross-spawn/releases/tag/v7.1.0
- https://github.com/moxystudio/node-cross-spawn
More moxystudio vulnerabilities
- TI-2026-101183 Argument injection in cross-spawn on Windows via backslashes CVSS 4.0HIGH 8.3
- TI-2026-101182 Command injection in cross-spawn on Windows via cmd.exe CVSS 3.1HIGH 8.1
Sources
- CVE-2026-137199 · CVE Program
- CVE-2026-137199 · NVD
- GHSA-ghv9-86vm-4v8m · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences