The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-22931

CVE-2021-22931: Node.js DNS Library RCE Vulnerability

CVE-2021-22931 is a remote code execution flaw in Node.js DNS library caused by missing input validation of hostnames. Attackers can exploit this for domain hijacking and injection attacks. Learn the technical details.

Published: March 4, 2026

CVE-2021-22931 Overview

Node.js versions before 16.6.0, 14.17.4, and 12.22.4 contain a critical vulnerability in the DNS library due to missing input validation of hostnames returned by Domain Name Servers. This flaw enables Remote Code Execution (RCE), Cross-Site Scripting (XSS), and application crashes. Attackers can exploit this vulnerability to output incorrect hostnames, potentially leading to Domain Hijacking and injection vulnerabilities in applications utilizing the affected library.

Critical Impact

This vulnerability allows remote attackers to execute arbitrary code, inject malicious scripts, crash applications, or hijack domains without requiring authentication or user interaction. The network-accessible attack vector combined with low exploitation complexity makes this a severe threat to affected Node.js deployments.

Affected Products

  • Node.js (versions before 16.6.0, 14.17.4, and 12.22.4)
  • NetApp Active IQ Unified Manager (VMware vSphere and Windows)
  • NetApp NextGen API
  • NetApp OnCommand Insight
  • NetApp OnCommand Workflow Automation
  • NetApp SnapCenter
  • Oracle GraalVM Enterprise Edition (20.3.3 and 21.2.0)
  • Oracle MySQL Cluster
  • Oracle PeopleSoft Enterprise PeopleTools (8.57, 8.58, 8.59)
  • Siemens SINEC Infrastructure Network Services

Discovery Timeline

  • August 16, 2021 - CVE-2021-22931 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2021-22931

Vulnerability Analysis

This vulnerability resides in Node.js's DNS library and stems from improper input validation (CWE-20) combined with improper null termination (CWE-170). When the DNS library processes hostname responses from DNS servers, it fails to properly validate and sanitize the returned data before passing it to dependent application components.

The lack of input validation creates multiple attack surfaces. An attacker controlling or manipulating DNS responses can inject malicious payloads that the Node.js application will process as legitimate hostnames. This can result in code execution when the tainted hostname is used in security-sensitive operations, XSS attacks when hostnames are rendered in web contexts, or application crashes due to unexpected input handling.

Root Cause

The root cause is the absence of proper input validation for DNS responses in the Node.js dns library. When DNS queries are performed, the library accepts hostname data from DNS servers without adequate sanitization checks. This violates the principle of never trusting external input, especially from network sources that can be manipulated through DNS spoofing, cache poisoning, or malicious authoritative servers.

The improper null termination handling (CWE-170) further exacerbates the issue, as string boundaries may be incorrectly interpreted, allowing attackers to inject additional data beyond expected hostname values.

Attack Vector

The attack leverages the network-accessible DNS resolution process. An attacker can exploit this vulnerability through several methods:

  1. DNS Spoofing/Cache Poisoning: Injecting malicious DNS responses containing crafted hostnames with embedded payloads
  2. Malicious DNS Server: Configuring a DNS server to return specially crafted hostname values when queried by the vulnerable Node.js application
  3. Man-in-the-Middle: Intercepting and modifying DNS responses in transit

When the Node.js application processes these malformed hostnames, the injected content can execute as code, render as XSS payloads in web contexts, or cause the application to crash due to improper handling of unexpected input. The vulnerability requires no privileges or user interaction to exploit, as it operates entirely through automated DNS resolution processes.

Detection Methods for CVE-2021-22931

Indicators of Compromise

  • Unusual DNS responses containing non-standard characters, escape sequences, or embedded JavaScript in hostname fields
  • Application logs showing unexpected hostname values with special characters or code fragments
  • Web application errors or crashes coinciding with DNS resolution activities
  • Evidence of XSS attacks originating from server-side hostname processing
  • DNS query patterns indicating potential cache poisoning or spoofing attempts

Detection Strategies

  • Monitor DNS traffic for anomalous hostname responses containing script tags, encoded characters, or excessively long values
  • Implement application-level logging for all DNS resolution operations to capture and analyze returned hostnames
  • Deploy network intrusion detection rules to identify malformed DNS responses
  • Review web application firewalls for XSS patterns originating from internal DNS-related processing
  • Audit Node.js application logs for crashes or exceptions in DNS-related code paths

Monitoring Recommendations

  • Enable verbose logging for Node.js DNS library operations during the remediation period
  • Configure SIEM rules to alert on hostname values containing potentially malicious patterns
  • Monitor application performance metrics for unexpected crashes or resource consumption spikes
  • Track DNS query and response pairs to identify discrepancies indicative of manipulation
  • Implement continuous vulnerability scanning to identify unpatched Node.js instances

How to Mitigate CVE-2021-22931

Immediate Actions Required

  • Upgrade Node.js immediately to version 16.6.0, 14.17.4, 12.22.4, or later depending on your release line
  • Audit all applications using the Node.js dns library to assess exposure
  • Implement DNS response validation at the application layer as a defense-in-depth measure
  • Review network architecture for DNS security controls such as DNSSEC
  • Coordinate with vendors of affected third-party products (NetApp, Oracle, Siemens) for their respective patches

Patch Information

Node.js has released security updates addressing this vulnerability. Organizations should upgrade to the following minimum versions:

  • Node.js 16.x: Upgrade to 16.6.0 or later
  • Node.js 14.x (LTS): Upgrade to 14.17.4 or later
  • Node.js 12.x (LTS): Upgrade to 12.22.4 or later

For detailed patch information, refer to the Node.js August 2021 Security Releases. Additional vendor-specific patches are available from Oracle CPU October 2021, Oracle CPU January 2022, and Siemens Security Advisory SSA-389290.

Workarounds

  • Implement application-level hostname validation before using DNS-resolved values in security-sensitive contexts
  • Deploy web application firewalls with rules to block XSS patterns in responses derived from DNS operations
  • Use DNS-over-HTTPS (DoH) or DNS-over-TLS (DoT) to reduce the risk of DNS response manipulation
  • Isolate Node.js applications with strict network segmentation to limit exposure to malicious DNS responses
  • Consider implementing allowlists for expected hostname patterns where feasible
bash
# Verify Node.js version and upgrade if vulnerable
node --version

# Update Node.js using nvm (Node Version Manager)
nvm install 16.6.0
nvm use 16.6.0

# Or update via package manager (Debian/Ubuntu)
sudo apt update
sudo apt install nodejs

# Verify the updated version
node --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechNodejs

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability1.36%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-170

  • CWE-20
  • Technical References
  • HackerOne Report #1178337

  • Gentoo GLSA 202401-02

  • NetApp Advisory NTAP-20210923-0001

  • NetApp Advisory NTAP-20211022-0003

  • Oracle CPU July 2022 Alerts
  • Vendor Resources
  • Siemens Security Advisory SSA-389290

  • Node.js Security Release Analysis

  • Oracle CPU January 2022 Alerts

  • Oracle CPU October 2021 Alerts
  • Related CVEs
  • CVE-2024-21892: Node.js Privilege Escalation RCE Vulnerability

  • CVE-2022-32223: Node.js DLL Hijacking RCE Vulnerability

  • CVE-2026-21711: Node.js Privilege Escalation Vulnerability

  • CVE-2026-21712: Node.js URL Processing DoS Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English