CVE-2022-32212: Command Injection
A OS Command Injection vulnerability exists in Node.js versions <14.20.0, <16.20.0, <18.5.0 due to an insufficient IsAllowedHost check that can easily be bypassed because IsIPAddress does not properly check if an IP address is invalid before making DBS requests allowing rebinding attacks.
Other sources
A vulnerability was found in NodeJS, where the IsAllowedHost check can be easily bypassed because IsIPAddress does not properly check if an IP address is invalid or not. When an invalid IPv4 address is provided (for instance, 10.0.2.555 is provided), browsers (such as Firefox) will make DNS requests to the DNS server. This issue provides a vector for an attacker-controlled DNS server or a Man-in-the-middle attack (MITM) who can spoof DNS responses to perform a rebinding attack and then connect to the WebSocket debugger allowing for arbitrary code execution on the target system.
CVE-2022-32212
The IsAllowedHost check can easily be bypassed because IsIPAddress does not properly check if an IP address is invalid or not. When an invalid IPv4 address is provided (for instance 10.0.2.555 is provided), browsers (such as Firefox) will make DNS requests to the DNS server, providing a vector for an attacker-controlled DNS server or a MITM who can spoof DNS responses to perform a rebinding attack and hence connect to the WebSocket debugger, allowing for arbitrary code execution. This is a bypass of CVE-2021-22884.
More details will be available at CVE-2022-32212 after publication.
Thank you to Axel Chong for reporting this vulnerability.
Impacts:
All versions of the 18.x, 16.x, and 14.x releases lines.
https://nodejs.org/en/blog/vulnerability/july-2022-security-releases/
— Red Hat
Node.js could allow a remote attacker to execute arbitrary code on the system, caused by the failure to properly check if an IP address is invalid or not by IsIPAddress. By controlling the victim's DNS server or spoofing its responses, an attacker could exploit this vulnerability to bypass the IsAllowedHost check and execute arbitrary code on the system.
— IBM
Affected Software
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2022-32212?
CVE-2022-32212 is an OS Command Injection vulnerability in Node.js versions <14.20.0 <16.20.0 <18.5.0.
How severe is CVE-2022-32212?
CVE-2022-32212 has a severity rating of 8.1 (High).
What software versions are affected by CVE-2022-32212?
Node.js versions <14.20.0, <16.20.0, and <18.5.0 are affected by CVE-2022-32212.
How can I fix CVE-2022-32212?
To fix CVE-2022-32212, update your Node.js installation to version 14.20.0 or later.
Where can I find more information about CVE-2022-32212?
You can find more information about CVE-2022-32212 on the Red Hat Security Advisory and Node.js official website.