Vulnerability DatabaseCVE-2026-137198

CVE-2026-137198: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-137198 is an argument injection vulnerability in cross-spawn, a cross-platform Node.js spawn/spawnSync solution maintained by moxystudio. On Windows, affected versions failed to correctly double runs of backslashes before a double quote or at the end of an argument when routing commands through cmd.exe, allowing attacker-controlled text to escape argument quoting and inject additional arguments. Affected versions are >= 6.0.6, < 6.0.7 and >= 7.0.4, < 7.1.0; other platforms are not affected. The vulnerability was privately reported by Duong Bui Thai and disclosed on November 28–30, 2026, with patches released the same day. It carries a CVSS v4.0 base score of 8.3 (High) (GitHub Advisory, Feedly).

Technical details

The root cause is CWE-88 (Improper Neutralization of Argument Delimiters in a Command — Argument Injection). A prior fix for a ReDoS vulnerability (GHSA-3xgq-45jj-v275) introduced a regex-based backslash-doubling algorithm that only added one backslash to each run instead of doubling the entire run; version 7.0.4 did not double them at all. When cross-spawn routes a non-executable command (e.g., a .bat or .cmd file) through cmd.exe on Windows, it wraps each argument in double quotes and is supposed to double any backslashes immediately preceding a quote or at the argument's end. Because this doubling was incorrect, an argument containing two or more backslashes before a closing quote — such as x\\ --evil — would escape the closing quote, causing the argument to split and inject extra tokens into the command line. The affected command class prominently includes npm cmd-shims in node_modules/.bin, which are invoked by virtually every npm script on Windows (GitHub Advisory, PR #191).

Impact

An attacker who can control arguments passed to a cross-spawn-invoked command on Windows can inject additional arguments or cause following arguments to be consumed, silently altering the target program's behavior. For example, a tool invoked with --check could receive an injected --write, causing unintended file modifications; conversely, a program that rejects unexpected arguments may fail instead. Critically, the calling application cannot reliably detect the injection because the command may still exit successfully with no stderr output. The vulnerability does not by itself enable execution of a second command and does not affect Linux or macOS systems (GitHub Advisory).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation at the time of disclosure (Feedly). The EPSS score is 0.0, reflecting low current exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exploitation requires the attacker to control untrusted input that is passed as arguments to a command routed through cmd.exe on Windows, which is a prerequisite that limits the attack surface to applications explicitly handling user-supplied data in spawned processes.

Exploitation steps

  1. Identify a vulnerable application: Find a Node.js application running on Windows that uses cross-spawn versions 6.0.6 or 7.0.4–7.0.6 and passes user-supplied or externally influenced data as arguments to a command that resolves to a .bat or .cmd file (including npm cmd-shims in node_modules/.bin).
  2. Craft a malicious argument: Construct an argument containing two or more backslashes immediately before a double quote or at the end of the string, such as x\\\ --injected-flag. Due to the flawed escaping, the backslashes will escape the closing quote rather than being doubled.
  3. Submit the payload: Deliver the crafted argument through whatever input channel the application exposes (e.g., an API parameter, CLI input, form field) that feeds into the cross-spawn call.
  4. Argument injection occurs: cmd.exe receives the malformed command line, interprets the escaped quote as part of the argument rather than its terminator, and parses the injected text as additional arguments to the target program.
  5. Observe altered behavior: The target program acts on the injected arguments (e.g., performing a write operation instead of a read-only check), or fails if it rejects unexpected arguments — in either case, the calling application may not detect the anomaly because the process can exit with code 0 and no stderr output (GitHub Advisory, PR #191).

Indicators of compromise

  • Logs: Application logs showing unexpected argument values or flags passed to spawned child processes; Node.js process logs indicating commands exiting successfully despite receiving unrecognized arguments.
  • Process: Child processes (e.g., npm scripts, .cmd shims in node_modules/.bin) observed receiving unexpected command-line arguments that differ from what the parent application intended to pass.
  • File System: Unexpected file modifications in directories managed by tools invoked via npm scripts (e.g., formatter or linter output files written when only a check was intended).
  • Network: No specific network indicators; the vulnerability is local to argument handling on the Windows host.

Mitigation and workarounds

Update cross-spawn to version 6.0.7 (final 6.x release) or 7.1.0 (or later), which replace the flawed regex-based backslash-doubling with a loop-based algorithm that correctly handles any number of backslashes in linear time and adopts a double-quote-based escaping strategy for batch files (GitHub Advisory, PR #191). As a workaround where upgrading is not immediately possible, validate and sanitize untrusted input to permit only a known-safe subset of characters before passing it as arguments to spawned processes. Applications that do not pass untrusted input to spawned commands on Windows are not at risk.

Community reactions

The vulnerability was privately reported by Duong Bui Thai and independently discovered and partially fixed by community contributors @trackoor and @ogffx via pull requests #188 and #190 before the maintainer (satazor) merged the comprehensive fix in PR #191. The fix also addresses a related batch-file escaping issue (GHSA-ghv9-86vm-4v8m) and adopts the same double-quote-based approach that Rust adopted for batch files following the BatBadBut vulnerability (CVE-2024-24576), indicating awareness of the broader Windows argument-escaping problem space in the open-source community (GitHub Advisory, PR #191).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

RHEL / CentOS

Affected

OpenShift

openshift4/ose-console

Affected

RHEL 8

Not Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-141544HIGH7.4
  • JavaScript logoJavaScript
  • @convex-dev/auth
NoYesDec 02, 2026
GHSA-wmpw-3r4v-3cfqMEDIUMN/A
  • JavaScript logoJavaScript
  • seamless-auth-api
NoYesDec 02, 2026
GHSA-whmp-4gff-3wj4HIGHN/A
  • JavaScript logoJavaScript
  • seamless-auth-api
NoYesDec 02, 2026
GHSA-wf95-5mxm-9w7mMEDIUMN/A
  • JavaScript logoJavaScript
  • @seamless-auth/oidc-provider
NoYesDec 02, 2026
GHSA-rpv3-mpqm-rvhxMEDIUMN/A
  • JavaScript logoJavaScript
  • seamless-auth-api
NoYesDec 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management