CVE-2026-137199: cross-spawn: Command injection on Windows when spawning batch files

Published Nov 30, 2026
·
Updated

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 nodemodules/.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.

Affected Software

1 affected component
npm/cross-spawn<6.0.7, >=7.0.0<7.1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/cross-spawn to a version that resolves this vulnerability.

    Fixed in 6.0.7
  2. Upgrade

    Upgrade npm/cross-spawn to a version that resolves this vulnerability.

    Fixed in 7.1.0

Event History

Nov 30, 2026
CVE Published
via MITRE·08:39 PM
Data Sourced
via MITRE·08:39 PM
DescriptionWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Only Windows applications are affected, and only when they pass untrusted arguments to commands that are routed through cmd.exe and ultimately invoke a batch file outside node_modules/.bin. Other platforms are not affected.

2

What attacker-controlled input is required for exploitation?

An attacker must be able to supply crafted command arguments. The risk arises when those arguments are forwarded through batch files such as npm.cmd, globally installed package shims, or user batch files, allowing a value to escape quoting during cmd.exe's second parse.

3

Are default cross-spawn uses affected?

The issue does not affect the intentionally unescaped options.shell mode, and it requires the specific Windows cmd.exe and external batch-file forwarding path. Batch-file detection could also be bypassed with trailing dots or spaces.

4

What versions contain the fix?

Upgrade to cross-spawn 6.0.7 or 7.1.0. Versions before those releases are affected under the described Windows execution conditions.

5

Are there environment-dependent exploitation conditions?

Yes. Percent-delimited variables may expand when an environment variable with the same name followed by a caret exists, while exclamation-delimited variables may expand when delayed expansion is enabled in the registry.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203