Vulnerability DatabaseCVE-2026-137197

CVE-2026-137197: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-137197 is an OS command injection vulnerability in the cross-spawn npm package (by moxystudio), a cross-platform solution for Node.js spawn and spawnSync. On Windows, when a command passed through cmd.exe is not written as a plain program name or path, cross-spawn may fail to detect that cmd.exe will resolve a batch file, causing arguments to be escaped incorrectly and allowing command metacharacters to be interpreted by cmd.exe. Affected versions are all releases before 6.0.8 and versions 7.0.0 through 7.1.0 (inclusive). The vulnerability was published on November 30, 2026, with a CVSS v3.1 base score of 8.1 (High) (GitHub Advisory, Feedly).

Technical details

The root cause is improper neutralization of special elements used in an OS command (CWE-78). Cross-spawn routes non-executable commands (e.g., .bat and .cmd batch files) through cmd.exe on Windows and applies stricter argument escaping when it detects a batch file target. However, the batch file detection logic could be bypassed when the command string contained double quotes (e.g., spawn('"tool.bat"', args)), command-name delimiters such as spaces, tabs, commas, semicolons, or equals signs (e.g., spawn('npm install', args)), trailing whitespace, or a child-specific PATHEXT environment variable that caused cmd.exe to resolve a batch file the parent process would not. In these cases, arguments were escaped as if targeting a regular executable, allowing an attacker-controlled argument such as "&calc to inject and execute arbitrary cmd.exe commands. The fix, implemented in PRs #196 (7.x) and #197 (6.x), ensures the command is always quoted when passed to cmd.exe and resolves the command using the child process's PATHEXT (GitHub Advisory, PR #196, PR #197).

Impact

Successful exploitation allows an unauthenticated remote attacker to execute arbitrary OS commands with the privileges of the Node.js process running on the affected Windows host. This results in high confidentiality, integrity, and availability impact — an attacker could read sensitive files, modify system state, install malware, or disrupt service operation. The scope is limited to the affected component, but the process-level access gained could enable lateral movement within the host environment (GitHub Advisory, Feedly).

Exploitability

As of the time of publication, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (Feedly). The EPSS score is 0.0, indicating a currently low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires that the target application runs on Windows, uses cross-spawn with a command in one of the vulnerable forms, and passes untrusted user input as arguments — conditions that may be common in Node.js build tooling and CI/CD pipelines (GitHub Advisory).

Exploitation steps

  1. Identify a vulnerable target: Find a Node.js application running on Windows that uses cross-spawn (versions < 6.0.8 or 7.0.0–7.1.0) and passes user-controlled input as arguments to a spawn or spawnSync call where the command is not a plain program name (e.g., spawn('npm install', userInput) or spawn('"tool.bat"', userInput)).
  2. Craft a malicious argument: Prepare a payload that includes cmd.exe metacharacters, such as "&calc or " & echo injected & ", which will be interpreted by cmd.exe as command separators when argument escaping is applied incorrectly.
  3. Submit the payload: Deliver the malicious argument through the application's input surface (e.g., an HTTP request parameter, form field, or API call) that is passed directly to the vulnerable spawn call.
  4. Trigger batch file resolution: Because the command form causes cross-spawn to miss that cmd.exe will resolve a batch file, the argument is escaped as if targeting a regular executable, allowing the metacharacters to pass through to cmd.exe unescaped.
  5. Achieve arbitrary command execution: cmd.exe interprets the injected metacharacters and executes the attacker's commands with the privileges of the Node.js process (GitHub Advisory, PR #196).

Indicators of compromise

  • Process: Unexpected child processes spawned by the Node.js process on Windows (e.g., cmd.exe, calc.exe, powershell.exe, net.exe) that are not part of normal application behavior.
  • Logs: Application logs showing unusual or malformed arguments passed to spawn/spawnSync calls, particularly arguments containing &, |, ", or other cmd.exe metacharacters.
  • Network: Unexpected outbound network connections from the Node.js process to external IPs, which may indicate a reverse shell or data exfiltration attempt following successful command injection.
  • File System: New or modified files in the application directory or temp folders created by the Node.js process, such as scripts, executables, or configuration files not associated with normal application operation.

Mitigation and workarounds

Upgrade cross-spawn to version 6.0.8 or 7.1.1, which fix the vulnerability by always quoting commands passed to cmd.exe and resolving commands using the child process's PATHEXT (GitHub Advisory). Versions before 6.0.0 are no longer maintained and will not receive a fix; users on those versions should upgrade to 7.1.1 (using overrides in package.json if needed). As a workaround, pass the program as the command and its arguments separately in args without quotes — e.g., spawn('npm', ['install', ...]) — and avoid setting PATHEXT in options.env. Additionally, validate and sanitize all command arguments, and avoid passing untrusted user input directly to spawn functions.

Community reactions

The vulnerability was disclosed by the cross-spawn maintainer (satazor) via a GitHub Security Advisory on November 28, 2026, alongside the release of patched versions. The advisory notes this is a bypass of the earlier batch file escaping fix (GHSA-ghv9-86vm-4v8m) introduced in versions 7.1.0 and 6.0.7. No significant broader media coverage or notable external researcher commentary has been identified beyond the official advisory and standard vulnerability tracking feeds (GitHub Advisory).

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

GHSA-j7r2-xppq-m353HIGH7.5
  • JavaScript logoJavaScript
  • websocket-driver
NoYesDec 03, 2026
GHSA-hr8p-3p6h-9fw3MEDIUM6.1
  • JavaScript logoJavaScript
  • tinymce
NoYesDec 03, 2026
GHSA-4pv6-c8h9-q8v6MEDIUM4.7
  • JavaScript logoJavaScript
  • tinymce
NoYesDec 03, 2026
GHSA-4fq4-f4jg-3vmxMEDIUM4.7
  • JavaScript logoJavaScript
  • tinymce
NoYesDec 03, 2026
CVE-2026-142608NONEN/A
  • JavaScript logoJavaScript
  • mongoose
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