CVE-2020-8277 Overview
A Node.js application that allows an attacker to trigger a DNS request for a host of their choice could trigger a Denial of Service in versions prior to 15.2.1, 14.15.1, and 12.19.1. The vulnerability is exploited by getting the application to resolve a DNS record with a larger number of responses, leading to resource exhaustion. This issue affects the c-ares DNS library used by Node.js and has been fixed in versions 15.2.1, 14.15.1, and 12.19.1.
Critical Impact
Network-accessible denial of service vulnerability allowing unauthenticated attackers to cause service disruption in Node.js applications by manipulating DNS resolution with excessive response records.
Affected Products
- Node.js versions < 15.2.1, < 14.15.1, and < 12.19.1
- Fedora 32 and 33
- Oracle Blockchain Platform
- Oracle GraalVM Enterprise Edition 19.3.4 and 20.3.0
- Oracle JD Edwards EnterpriseOne Tools
- Oracle MySQL Cluster
- Oracle Retail Xstore Point of Service (16.0.6, 17.0.4, 18.0.3, 19.0.2)
- c-ares (underlying DNS library)
Discovery Timeline
- November 19, 2020 - CVE-2020-8277 published to NVD
- November 21, 2024 - Last updated in NVD database
Technical Details for CVE-2020-8277
Vulnerability Analysis
This vulnerability is classified as CWE-400 (Uncontrolled Resource Consumption), a resource exhaustion vulnerability affecting the DNS resolution functionality in Node.js applications. The root cause lies in how the c-ares DNS library, which Node.js uses for asynchronous DNS resolution, handles DNS responses containing an unusually large number of records.
When a Node.js application performs DNS lookups on attacker-controlled hostnames, a malicious DNS server can return responses with an excessive number of DNS records. The c-ares library does not implement adequate limits on the number of records it processes, leading to excessive memory allocation and CPU consumption. This can cause the Node.js process to become unresponsive or crash, resulting in a denial of service condition.
The vulnerability is particularly dangerous in applications that perform DNS resolution on user-supplied input, such as web applications that fetch external resources, email servers, or proxy services. Since no authentication is required and the attack can be initiated remotely over the network, this vulnerability poses a significant risk to internet-facing Node.js deployments.
Root Cause
The vulnerability originates in the c-ares DNS library's handling of DNS response records. When processing DNS responses, the library allocates memory for each record without enforcing reasonable limits on the total number of records or total response size. An attacker can craft DNS responses with thousands of records, causing the library to consume excessive system resources. This lack of input validation in DNS response processing allows a single malicious DNS query to trigger resource exhaustion on the target system.
Attack Vector
The attack can be executed remotely over the network without requiring any authentication or user interaction. An attacker needs to control a DNS server and convince a vulnerable Node.js application to resolve a hostname pointing to their malicious DNS infrastructure. This can be achieved through various means, such as providing a malicious URL to a web scraping service, embedding resources from attacker-controlled domains in web applications, or manipulating user input that gets passed to DNS resolution functions.
The attack flow involves the following steps: the attacker registers a domain and configures a malicious DNS server to return oversized responses. When the vulnerable Node.js application attempts to resolve the attacker's hostname, the malicious DNS server responds with an excessive number of DNS records. The c-ares library processes all records, allocating memory for each one, ultimately exhausting system resources and causing a denial of service.
Detection Methods for CVE-2020-8277
Indicators of Compromise
- Unusual spikes in memory consumption by Node.js processes during DNS resolution operations
- DNS queries to unfamiliar or suspicious domains followed by process crashes or unresponsiveness
- Network traffic showing DNS responses with abnormally large payload sizes (significantly exceeding typical DNS response sizes)
- Process monitoring showing Node.js applications becoming unresponsive after external DNS requests
Detection Strategies
- Monitor Node.js process resource utilization (memory and CPU) for abnormal spikes correlated with DNS activity
- Implement DNS response size monitoring at the network level to detect oversized DNS responses
- Deploy application-level logging to track DNS resolution requests and correlate with resource exhaustion events
- Use runtime application self-protection (RASP) solutions to detect and block anomalous DNS resolution patterns
Monitoring Recommendations
- Configure alerts for Node.js process memory usage exceeding baseline thresholds during DNS operations
- Implement network-level DNS traffic analysis to identify responses with excessive record counts
- Enable detailed logging for DNS resolution functions such as dns.resolve() and dns.lookup() in Node.js applications
- Monitor for process restarts or crashes in Node.js services that may indicate exploitation attempts
How to Mitigate CVE-2020-8277
Immediate Actions Required
- Upgrade Node.js to patched versions: 15.2.1 or later, 14.15.1 or later, or 12.19.1 or later
- Audit applications to identify code paths that perform DNS resolution on user-controlled input
- Implement input validation and allowlisting for hostnames that applications are permitted to resolve
- Consider implementing DNS resolution timeouts and resource limits at the application level
Patch Information
Node.js has released security patches addressing this vulnerability. Update to the following fixed versions immediately:
- Node.js 15.x: Upgrade to 15.2.1 or later
- Node.js 14.x (LTS): Upgrade to 14.15.1 or later
- Node.js 12.x (LTS): Upgrade to 12.19.1 or later
For detailed patch information, refer to the Node.js Security Blog Post. Organizations using Oracle products should consult the relevant Oracle security advisories including the Oracle January 2021 Security Alert and subsequent quarterly updates.
Additional distribution-specific patches are available through Fedora and Gentoo security advisories.
Workarounds
- Implement network-level DNS response filtering to block responses exceeding reasonable size thresholds
- Use application-level allowlists to restrict DNS resolution to trusted domains only
- Deploy a local DNS proxy or resolver that validates and limits DNS response sizes before passing to applications
- Implement rate limiting on DNS resolution requests to reduce the impact of potential exploitation attempts
# Example: Verify Node.js version is patched
node --version
# Should output v15.2.1+, v14.15.1+, or v12.19.1+
# Example: Check installed Node.js for vulnerable versions
npm list | grep node
# Ensure all Node.js dependencies are updated
# Example: Update Node.js using nvm (Node Version Manager)
nvm install 14.15.1
nvm use 14.15.1
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


