CVE-2021-22931CWE-170

Node.js before 16.6.0, 14.17.4, and 12.22.4 is vulnerable to Remote Code Execution, XSS, Application crashes due to missing input validation of host names…

published August 16, 2021

CVSS
—
EPSS
22%
Percentile
97.7
In the wild
Unconfirmed
What it is

⚠️ A missing input validation in Node.js is like a restaurant forgetting to check IDs at the door — it opens the door to chaos! Think of the Node.js dns library as a restaurant's reservation system. If it doesn’t double-check names or allows wrong names to slip through, customers could end up being seated at the wrong tables — leading to all sorts of mix-ups and confusion. This flaw could allow attackers to take control of your application, leading to Remote Code Execution (RCE) or nasty XSS exploits — essentially giving them the keys to your kitchen! In the worst-case scenario, this could lead to domain hijacking, where attackers can impersonate your legitimate services. Absolutely devastating for your users' trust.

Put simply

Think of the Node.js dns library as a restaurant's reservation system. If it doesn’t double-check names or allows wrong names to slip through, customers could end up being seated at the wrong tables — leading to all sorts of mix-ups and confusion. The vulnerability in Node.js affects versions before 16.6.0, 14.17.4, and 12.22.4 due to improper validation of hostnames returned by DNS queries, which can lead to incorrect hostname outputs and potential injections in applications using this library.

What to do

This flaw could allow attackers to take control of your application, leading to Remote Code Execution (RCE) or nasty XSS exploits — essentially giving them the keys to your kitchen! In the worst-case scenario, this could lead to domain hijacking, where attackers can impersonate your legitimate services. Absolutely devastating for your users' trust. Upgrade Node.js to at least version 16.6.0, 14.17.4, or 12.22.4 to close this vulnerability. Additionally, review your application’s DNS handling for any unvalidated inputs. This will significantly enhance your security posture! You've got this! By taking these steps, you'll help keep your application and users safe and sound! 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.21952 · 97.7th percentile
Weakness
CWE-170 · Improper Null Termination
Published
2021-08-16T00:00Z
EPSS history
Timeline
  • 16 AUG 00:00Z
    Node.js before 16.6.0, 14.17.4, and 12.22.4 is vulnerable to Remote Code Execution, XSS, Application crashes due to missing input validation of host names…
    cvelistv5