CVE-2024-27980
Node.js vulnerability analysis and mitigation

Overview

A command injection vulnerability (CVE-2024-27980) was discovered in Node.js affecting all active release lines (18.x, 20.x, 21.x). The vulnerability stems from improper handling of batch files in childprocess.spawn and childprocess.spawnSync functions, specifically on Windows systems. The vulnerability was discovered and initially disclosed on April 10, 2024 (NodeJS Blog).

Technical details

The vulnerability allows a malicious command line argument to inject arbitrary commands and achieve code execution even when the shell option is not enabled. This occurs due to improper handling of batch files (.bat and .cmd) in childprocess.spawn and childprocess.spawnSync functions. The vulnerability has been assigned a CVSS v3.0 Base Score of 8.1 (HIGH) with the vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

The vulnerability affects all Windows users across Node.js active release lines 18.x, 20.x, and 21.x. When exploited, it allows attackers to execute arbitrary commands on the system, potentially leading to complete system compromise (NodeJS Blog).

Mitigation and workarounds

Node.js has implemented a fix by disallowing direct .bat and .cmd file spawning. The fix was released in version 18.20.2 and corresponding versions in other release lines. For users who need to execute batch files, they must now explicitly set { shell: true } as an option. While it's possible to use --security-revert=CVE-2024-27980 to revert the security patch, this is strongly discouraged (NodeJS Blog).

Additional resources


SourceThis report was generated using AI

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

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