Open DNS Resolver
The DNS server answers recursive queries from any address on the internet, so it can be used to amplify denial of service attacks against third parties.
| Severity | Medium |
| CVSS 3.1 | 5.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L Open in the calculator |
| CVSS 4.0 | 6.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:N/SA:L Open in the calculator |
| CWE | CWE-406: Insufficient Control of Network Message Volume (Network Amplification) |
| MITRE ATT&CK | T1498.002 Reflection Amplification |
| Category | Security Misconfiguration |
Description
The DNS server performs recursive resolution, looking up names in domains it is not authoritative for, on behalf of any client that asks, including clients on the internet. Recursive service is needed only by the organisation's own users and systems; offering it to everyone makes the server an open resolver.
Open resolvers are abused for reflection and amplification attacks: an attacker sends small queries with the victim's address forged as the source, and the server sends much larger responses, such as large record sets or DNSSEC-signed answers, to the victim. Because DNS normally uses UDP, the server cannot tell that the source address is forged. An attacker can in this way direct large volumes of traffic at a third party, contributing to denial of service attacks that are traced back to the organisation's network, which consumes the organisation's bandwidth and server capacity and can lead to its addresses being placed on block lists or to complaints from the victim or upstream providers.
An open resolver also lets outsiders learn what is in its cache, though the server's own data is not otherwise exposed, and it is a more attractive target for cache poisoning, which would redirect the organisation's own users if they rely on it.
The issue is confirmed by sending a recursive query for a domain the server is not authoritative for from a host outside the organisation's network, for example with dig, and receiving an answer with the recursion available flag set; the Nmap dns-recursion script makes the same check. It often arises when a server that hosts the organisation's public zones also has recursion enabled, as Windows DNS Server does by default, or when the access controls on a recursive server are too broad.
Remediation
Restrict recursion to the clients that need it, and separate public authoritative DNS from internal recursive DNS:
- On servers that host public zones, disable recursion. On BIND, set
recursion no;in theoptionsblock. On Windows DNS Server, select Disable recursion (also disables forwarders) on the Advanced tab of the server's properties, or runSet-DnsServerRecursion -Enable $false. - On recursive servers, allow recursion only from internal networks. On BIND, set
allow-recursionandallow-query-cacheexplicitly, as below, because when they are not set BIND derives them from other settings such asallow-query. On Unbound, list internal ranges withaccess-controland keep the default refusal for everything else. On Windows DNS Server, where one server must do both jobs, use DNS policy with recursion scopes (selective recursion control) to offer recursion only to internal clients. - Block inbound DNS from the internet to recursive servers at the firewall.
- On authoritative servers, enable response rate limiting where the software supports it, to reduce their usefulness for amplification.
Add the organisation's other internal ranges to the acl. Confirm the fix by repeating a recursive query for an external domain from outside the network, which should be refused or go unanswered.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.