Node.js · runtime · 2024-04-10

Node.js Windows batch injection

CVE CVE-2024-27980 High

A Windows-only Node.js core flaw in how batch files are handled. The fix introduced a deliberate breaking change for .bat and .cmd execution.

Patch status
Patch available
Exploitation
Exploitation unknown
CISA KEV
Not listed

Key facts

Each fact is linked to the source that supports it.
  1. The issue is specific to Windows and to child_process spawn/spawnSync handling of batch files. Node.js Project
  2. The fix introduced a breaking change: .bat/.cmd without shell:true now errors with EINVAL. Node.js Project
  3. NVD scores the issue CVSS v3.0 8.1. NIST NVD

Summary

A malicious command-line argument can inject commands through child_process.spawn or spawnSync on Windows, even when the shell option is not enabled.

Component: Node.js core on Windows. Disclosed: 10 April 2024. Last verified: 22 October 2026, 16:45 UTC.

Affected versions

Product Affected range Note
Node.js 18.x < 18.20.2 Windows only.
Node.js 20.x < 20.12.2 Windows only.
Node.js 21.x < 21.7.3 Windows only.

Version ranges preserve the source wording. A distribution package may contain a backport without changing this string. Node.js Project NIST NVD

Fixed versions

Product Fixed version Note
Node.js 18.x 18.20.2 Security release, April 2024.
Node.js 20.x 20.12.2 Security release, April 2024.
Node.js 21.x 21.7.3 Security release, April 2024.

Fixed in 18.20.2, 20.12.2 and 21.7.3. The fix makes spawn/spawnSync return EINVAL for .bat/.cmd without shell:true. Node.js Project NIST NVD

Conditions and scope

These are the conditions named by the sources. They are not a score and not a prediction.

  • Windows host.
  • Application passes attacker-influenced arguments to child_process.spawn or spawnSync.
  • A .bat or .cmd file is involved, per the official advisory.

Exploitation status

No public confirmation of exploitation was found in the sources checked. This is not proof it was never exploited.

CISA KEV — not listed

Not present in the downloaded CISA KEV catalog.

Catalog version 2026.10.21 · checked 22 October 2026, 16:53 UTC .

Severity and scoring

Scores are listed with their version and assessor. Different CVSS versions, and different assessors, are not averaged. The presence of a high score does not establish exploitation, and a lower score does not make a memory-safety defect harmless.

8.1
CVSS v3.0 · High
NVD
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Mechanism

Node.js's Windows implementation of spawn and spawnSync handles batch files through cmd.exe. The advisory says improper handling allows a malicious command-line argument to inject commands even when the shell option is not enabled.

The fix deliberately changes behaviour. Code that legitimately runs .bat or .cmd files must pass shell:true, and only after sanitising the arguments. Treating the new EINVAL as a regression and reverting the security patch would reintroduce the flaw.

Scope

Linux and macOS deployments are not described as affected by this CVE. The condition is Windows plus attacker-influenced arguments. Applications that never spawn batch files are outside the described path.

This is Node.js core, not an npm package. The distinction matters when writing an inventory: a package scanner will not fix the runtime.

What to do

Sources

Sources for this record

Last verified 22 October 2026, 16:45 UTC. A statement that no evidence was found in checked sources is not a statement that an event never occurred.

Search PHP2Shell Live

Type to search the local index Results stay in your browser
↑ ↓ move Enter open Esc close