CVE-2026-137197: cross-spawn: Command injection on Windows when the command is not a plain program name or path

Published Nov 30, 2026
·
Updated

cross-spawn is a cross-platform solution for Node.js spawn and spawnSync. Prior to 6.0.8 and 7.1.1, applications running on Windows that pass untrusted arguments can be vulnerable when a command sent through cmd.exe is not written as a plain program name or path. Commands containing quotes, command-name delimiters, trailing whitespace, or a child-specific PATHEXT could cause cross-spawn to miss that cmd.exe would resolve a batch file. The arguments were then escaped as though the target were a regular program, allowing command metacharacters in an argument to be interpreted by cmd.exe and execute arbitrary commands. Applications are affected only when they use one of these command forms and pass untrusted input as arguments. This issue is fixed in versions 6.0.8 and 7.1.1.

Affected Software

1 affected component
npm/cross-spawn<6.0.8, <7.1.1

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.8
  2. Upgrade

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

    Fixed in 7.1.1

Event History

Nov 30, 2026
CVE Published
via MITRE·08:33 PM
Data Sourced
via MITRE·08:33 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are affected?

Only applications running on Windows are affected. The application must use cross-spawn with a command that is sent through cmd.exe and is not a plain program name or path, while also passing untrusted input as arguments.

2

What command forms can trigger the vulnerable behavior?

The affected command forms include commands containing quotes, command-name delimiters, trailing whitespace, or a child-specific PATHEXT. In these cases, cross-spawn can fail to recognize that cmd.exe will resolve the command as a batch file.

3

What does an attacker need to exploit this issue?

An attacker needs control over an argument passed as untrusted input to an affected cross-spawn invocation. Command metacharacters in that argument may then be interpreted by cmd.exe, allowing arbitrary command execution.

4

How can teams identify potentially vulnerable usage?

Review Windows code paths that call cross-spawn or spawnSync and trace whether user-controlled or otherwise untrusted values reach command arguments. Prioritize calls whose command strings include quotes, delimiters, trailing whitespace, or behavior dependent on a child-specific PATHEXT.

5

Which versions contain the fix?

The issue is fixed in cross-spawn versions 6.0.8 and 7.1.1. Versions prior to those releases are affected when the described Windows command and untrusted-argument conditions are present.

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