CVE-2026-137198: CVE-2026-137198: Argument Injection in Node.js cross-spawn via Improper Backslash Escaping on Windows
CVE-2026-137198: Argument Injection in Node.js cross-spawn via Improper Backslash Escaping on Windows Vulnerability ID: CVE-2026-137198 CVSS Score: 8.3 Published: 2026-12-04 CVE-2026-137198 is a high-severity argume
CVE-2026-137198: Argument Injection in Node.js cross-spawn via Improper Backslash Escaping on Windows
Vulnerability ID: CVE-2026-137198
CVSS Score: 8.3
Published: 2026-12-04
CVE-2026-137198 is a high-severity argument injection vulnerability (CWE-88) affecting the Node.js cross-spawn library in versions 6.0.6 and 7.0.4 through 7.0.6. On Windows systems, when commands are routed through cmd.exe (including batch files and npm cmd-shims in node_modules/.bin), cross-spawn fails to properly double contiguous sequences of two or more backslashes preceding a double quote or at the end of an argument. This parsing failure causes the argument's closing quotation mark to be escaped as a literal character, allowing attacker-controlled input to break out of quotation encapsulation and inject arbitrary command-line arguments or consume subsequent arguments.
TL;DR
An improper backslash escaping flaw in cross-spawn (versions 6.0.6 and 7.0.4 to 7.0.6) on Windows allows attackers to escape enclosing double quotes when commands are routed via cmd.exe, leading to arbitrary argument injection. Users must upgrade to cross-spawn 6.0.7 or 7.1.0.
β οΈ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-137198 (GHSA-m6qr-m48x-3xhh)
- Weakness Class: CWE-88: Argument Injection
- CVSS v4.0 Score: 8.3 High (CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N)
- EPSS Score: 0.562% (48.20th Percentile)
- Affected Versions: cross-spawn 6.0.6 and 7.0.4 - 7.0.6 (Windows only)
- Patched Versions: cross-spawn 6.0.7 and 7.1.0
- Exploit Status: Proof-of-Concept (Unit test fixtures; not in CISA KEV)
Affected Systems
- cross-spawn (npm package) on Microsoft Windows
-
cross-spawn: >= 6.0.6, < 6.0.7 (Fixed in:
6.0.7) -
cross-spawn: >= 7.0.4, < 7.1.0 (Fixed in:
7.1.0)
Code Analysis
Commit: 1b71aa5
Fix argument escaping and hardening for cmd.exe on branch 6.x (v6.0.7)
Commit: 244ffea
Fix argument escaping and hardening for cmd.exe on branch 7.x (v7.1.0)
Mitigation Strategies
- Upgrade cross-spawn to the latest patched version across direct and transitive dependencies.
- Bypass cmd.exe routing on Windows by executing .exe binaries directly or invoking Node.js scripts via process.execPath instead of node_modules/.bin/*.cmd shims.
- Enforce strict allowlist validation on user-supplied arguments passed to child processes, rejecting embedded double quotes, multiple contiguous backslashes, and newline characters.
Remediation Steps:
- Run
npm ls cross-spawn(oryarn why cross-spawn/pnpm why cross-spawn) to identify all installed versions ofcross-spawnacross the project dependency tree. - Upgrade
cross-spawnon the 6.x branch to>= 6.0.7and on the 7.x branch to>= 7.1.0vianpm update cross-spawnornpm audit fix. - If
cross-spawnis pinned by an upstream transitive dependency, configure an override inpackage.json(e.g.,"overrides": { "cross-spawn": "^7.1.0" }) and regenerate the lockfile. - Verify that any custom error handling accounts for the new
TypeErrorthrown bycross-spawn6.0.7 / 7.1.0 when arguments contain carriage return (\r) or newline (\n) characters on Windows.
References
- GitHub Security Advisory GHSA-m6qr-m48x-3xhh
- Patch Commit for cross-spawn 6.x (v6.0.7)
- Patch Commit for cross-spawn 7.x (v7.1.0)
- Pull Request #191 (v6.0.7 Fix)
- Pull Request #192 (v7.1.0 Fix)
- cross-spawn v6.0.7 Release Tag
- cross-spawn v7.1.0 Release Tag
- NVD Detail for CVE-2026-137198
- CVE.org Record for CVE-2026-137198
- CVEListV5 JSON Record for CVE-2026-137198
- Wiz Vulnerability Database: CVE-2026-137198
Read the full report for CVE-2026-137198 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.