This article needs additional citations for verification. (February 2012) (Learn how and when to remove this template message)
DNS rebinding is a form of computer attack. In this attack, a malicious web page causes visitors to run a client-side script that attacks machines elsewhere on the network. In theory, the same-origin policy prevents this from happening: client-side scripts are only allowed to access content on the same host that served the script. Comparing domain names is an essential part of enforcing this policy, so DNS rebinding circumvents this protection by abusing the Domain Name System (DNS).
This attack can be used to breach a private network by causing the victim's web browser to access computers at private IP addresses and return the results to the attacker. It can also be employed to use the victim machine for spamming, distributed denial-of-service attacks, or other malicious activities.
How DNS rebinding works
The malicious client-side code makes additional accesses to the original domain name (such as attacker.com). These are permitted by the same-origin policy. However, when the victim's browser runs the script it makes a new DNS request for the domain, and the attacker replies with a new IP address. For instance, they could reply with an internal IP address or the IP address of a target somewhere else on the Internet.
- DNS servers in the chain can filter out private IP addresses and loopback IP addresses:
- External public DNS servers (e.g. OpenDNS) can implement DNS filtering.
- Local system administrators can configure the organization's local nameserver(s) to block the resolution of external names into internal IP addresses. (This has the downside of allowing an attacker to map the internal address ranges in use.)
- A firewall (e.g. dnswall), in the gateway or in the local pc, can filter DNS replies that pass through it, discarding local addresses.
- Web browsers can resist DNS rebinding:
- Web browsers can implement DNS pinning: the IP address is locked to the value received in the first DNS response. This technique may block some legitimate uses of Dynamic DNS, and may not work against all attacks. However, it is important to fail safe (stop rendering) if the IP address does change, because using an IP address past the TTL expiration can open the opposite vulnerability when the IP address has legitimately changed and the expired IP address may now be controlled by an attacker.
- The NoScript extension for Firefox includes ABE, a firewall-like feature inside the browser which in its default configuration prevents attacks on the local network by preventing external webpages from accessing local IP addresses.
- Web servers can reject HTTP requests with an unrecognized Host header.
- "Protecting Browsers from DNS Rebinding Attacks" (PDF). crypto.stanford.edu. November 2007. Retrieved 2018-12-10.
- "Protecting Browsers from DNS Rebinding Attacks" (PDF). www.adambarth.com. January 2009. Retrieved 2018-12-10.
- "DNS REBINDING" (PDF). www.ptsecurity.com. 2012. Retrieved 2018-12-10.
- "Protecting Your Router Against Possible DNS Rebinding Attacks - TrendLabs Security Intelligence Blog". blog.trendmicro.com. 2010-08-04. Retrieved 2018-12-10.
- Ulevitch, David (2008-04-14). "Finally, a real solution to DNS rebinding attacks". Cisco. Retrieved 2017-07-15.
- google-dnswall on GitHub
- "Services — DNS — DNS Rebinding Protections | pfSense Documentation". www.netgate.com. Retrieved 2018-12-10.
- "FireDrill: Interactive DNS Rebinding" (PDF). www.usenix.org. Retrieved 2018-12-10.