CVE-2024-36138

Command Injection
Affects
Node.js
in
Node.js
No items found.
Versions
4.0 < 18.20.4, 20.0 < 20.15.1, 22.0< 22.4.1

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It offers an event-driven, non-blocking I/O model that makes it lightweight and efficient, and is widely used in server-side applications.

‍

An Command Injection vulnerability has been identified in Node.js. The issue stems from improper handling of batch files with all possible extensions on Windows via child_process.spawn / child_process.spawnSync. This weakness allows attackers to inject arbitrary commands and achieve code execution even if the shell option is not enabled.

‍

This vulnerability affects specific versions of the package and can result in total compromise of the system. Details on affected versions and reproduction steps are provided below.

‍

Details

Module Info

  • ‍Affected packages: Node.js‍
  • Affected versions: 4.0 < 18.20.4, 20.0 < 20.15.1, 22.0< 22.4.1 ‍
  • GitHub repository: https://github.com/nodejs/node‍
  • Published packages: https://github.com/nodejs/node/releases‍
  • Package manager: npm‍
  • Fixed in: Node.js NES version 16

‍

Vulnerability Info

The issue stems from improper handling of batch files with all possible extensions on Windows.

For instance, in a scenario where a malicious command line argument is provided, if the shell option is not enabled, the system can execute arbitrary commands. This behavior can be exploited by attackers to achieve code execution.

‍

This vulnerability is a result of flawed logic, and may allow attackers to execute arbitrary code.


- https://www.cve.org/CVERecord?id=CVE-2024-36138

- https://owasp.org/www-community/attacks/Command_Injection

‍

Mitigation

This vulnerability is not fixed upstream due to the release line being EOL. Herodevs has issued patched builds under the NES (Never Ending Support) line.


- Update to a patched LTS version of Node.js

- Leverage a commercial support partner like HeroDevs for post-EOL security.

Refer to the NES Documentation for upgrade instructions.

‍

Credits

  • tianst
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2024-36138
PROJECT Affected
Node.js
Versions Affected
4.0 < 18.20.4, 20.0 < 20.15.1, 22.0< 22.4.1
NES Versions Affected
Published date
September 7, 2024
≈ Fix date
March 27, 2025
Category
Command Injection
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Node.js
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.