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 web applications.
An Code Injection vulnerability has been identified in Node.js. The issue stems from maliciously crafted export names in an imported WebAssembly module that can inject JavaScript code. This weakness allows attackers to access data and functions that the WebAssembly module itself does not have access to.
This vulnerability affects specific versions of the package and can result in unauthorized access. Details on affected versions and reproduction steps are provided below.
Details
Module Info
Affected packages: Node.js
Affected versions: 4.0 <= 18.18.1, 20.0 <= 20.8.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 control of generation of code ('Code Injection').
For instance, in a WebAssembly context, if Node.js is started with the `--experimental-wasm-modules` command line option, the system may execute injected JavaScript code. This behavior can be exploited by attackers to access unauthorized data.
This vulnerability is a result of flawed logic, and may allow attackers to execute arbitrary code.
- https://nodejs.org/en/blog/vulnerability/october-2023-security-releases
- https://hackerone.com/reports/2225660
Credits
- dittyroma
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.