TuDoor Attack: Systematically Exploring and Exploiting Logic Vulnerabilities in DNS Response Pre-processing with Malformed Packets
Xiang Li, Wei Xu, Baojun Liu, Mingming Zhang, Zhou Li, Jia Zhang
IEEE Symposium on Security and Privacy 2024 · Day 3 · Continental Ballroom 4
Overview
The "TuDoor Attack" presentation at IEEE S&P unveiled a novel class of DNS-based attacks that systematically exploit logic vulnerabilities within the DNS response pre-processing mechanisms of widely used DNS resolvers. Led by Xiang Li from Nanjing University, the research team demonstrated how these subtle flaws, often overlooked in the development of DNS software, can lead to rapid and highly effective DNS cache poisoning, denial-of-service (DoS), and resource consumption attacks. The name "TuDoor" aptly reflects the nature of the vulnerability, likening it to a "door in the grid wall" that allows attackers to bypass established security measures.

Key moments
- 0:00 Introduction and TuDoor attack's rapid impact
- 2:00 DNS resolution basics and cache poisoning concept
- 2:40 Evolution of DNS cache poisoning attacks and defenses
- 8:00 Why DNS cache poisoning attacks persist (Marin)
- 9:40 TuDoor's core insight: Unstudied DNS response pre-processing logic
- 10:10 TuDoor attack mechanism and 100% success rate
- 11:00 TuDoor's systematic methodology for vulnerability discovery
TuDoor Attack: Systematically Exploring and Exploiting Logic Vulnerabilities in DNS Response Pre-processing with Malformed Packets
Speakers: Xiang Li, PhD Student, Nanjing University; Wei Xu; Baojun Liu; Mingming Zhang; Zhou Li; Jia Zhang
Conference: IEEE S&P
YouTube: https://www.youtube.com/watch?v=vfeg9oojcbo
Overview
The "TuDoor Attack" presentation at IEEE S&P unveiled a novel class of DNS-based attacks that systematically exploit logic vulnerabilities within the DNS response pre-processing mechanisms of widely used DNS resolvers. Led by Xiang Li from Nanjing University, the research team demonstrated how these subtle flaws, often overlooked in the development of DNS software, can lead to rapid and highly effective DNS cache poisoning, denial-of-service (DoS), and resource consumption attacks. The name "TuDoor" aptly reflects the nature of the vulnerability, likening it to a "door in the grid wall" that allows attackers to bypass established security measures.
This talk is significant because it shifts the focus from traditional attack vectors, which often target identification fields or fragmentation, to the fundamental logic governing how DNS resolvers parse and handle incoming packets. Despite decades of research and numerous mitigations against DNS cache poisoning, the TuDoor Attack reveals a critical, unaddressed blind spot in the DNS security landscape. By exploiting a covert side channel rooted in unexpected packet processing, attackers can achieve a 100% success rate in discovering ephemeral source ports, drastically accelerating cache poisoning attempts to mere seconds.
The implications of the TuDoor Attack are far-reaching. The research identified vulnerabilities in 24 different DNS software implementations, including popular recursive resolvers like BIND, Unbound, and PowerDNS, as well as operating system-level resolvers in Linux, Windows, and macOS, and various programming libraries. Furthermore, testing against 42 public DNS services revealed that many, including prominent ones like AdGuard DNS, OpenDNS, and Cloudflare DNS, are susceptible. This widespread impact underscores the urgent need for developers to re-evaluate and standardize their DNS response pre-processing logic, considering all possible state transitions and handling of malformed packets to safeguard the internet's foundational naming service.
Background
▶ Watch: Introduction and TuDoor attack's rapid impact (0:00)
The Domain Name System (DNS) is a cornerstone of the internet, serving as its phonebook by translating human-readable domain names into IP addresses. This critical function underpins virtually all online applications and services. The DNS operates on a hierarchical, distributed database model, with root, Top-Level Domain (TLD), and authoritative name servers maintaining records. When a client queries a domain name, a recursive resolver initiates an iterative process, querying various authoritative servers until it obtains the correct IP address. This response is then cached by the resolver to expedite future queries for the same domain.
Due to its fundamental role, the DNS has long been a target for attackers seeking to manipulate its responses or hijack its cache, a technique known as DNS cache poisoning. The primary vulnerability stems from DNS's reliance on UDP, a connectionless protocol that offers no inherent session integrity. Attackers aim to inject forged answers into a resolver's cache, leading legitimate users to malicious websites or services.
Historically, DNS cache poisoning attacks have evolved in sophistication, each prompting new mitigation strategies:
- On-Path Cache Poisoning (e.g., CachePoison): Early attacks exploited the lack of verification for responses, allowing an attacker on the network path to inject forged records. The primary mitigation was bailiwick checking, ensuring that a DNS resolver only accepts answers for the queried domain and its subdomains from the authoritative server responsible for that domain. This made on-path attacks significantly harder.
- Off-Path Cache Poisoning (e.g., Kaminsky Attack): Disclosed in 2008 by Dan Kaminsky, this attack leveraged the limited transaction ID (TXID) space (16 bits) used to match queries with responses. An attacker would flood a target resolver with many forged responses, each with a different TXID, hoping to guess the correct one before the legitimate response arrived. The key mitigation was source port randomization, increasing the guessing space for off-path attackers from 16 bits (TXID) to 32 bits (TXID + source port), making brute-forcing computationally infeasible.
- Fragmentation-Based Attacks: These attacks exploited vulnerabilities in how resolvers reassemble fragmented DNS UDP packets. Attackers could inject forged data into the second fragment, which often lacked the identification fields present in the first. Mitigations included IP ID randomization, reducing packet sizes to avoid fragmentation, using TCP for DNS (where possible), and adding new validation fields to fragments. The talk notes that despite these, increasing packet size with the same name chain could still allow fragmentation-based attacks.
- Side-Channel Attacks (e.g., SAD Attack): The SAD (Side-channel Attack on DNS) attack, disclosed in 2020, exploited a Linux kernel global counter to infer the ephemeral source port used by a resolver. By probing, attackers could reduce the entropy of the source port, making off-path attacks feasible again. Mitigations involved SMP global rate limit counter randomization in the Linux kernel, along with reducing DNS resolution timeouts.
- MasaNet Attack: This attack, revealed in 2021, demonstrated a bypass of bailiwick checking by exploiting logic flaws in forwarding resolvers. It allowed attackers to inject forged responses into forwarder caches that were shared with recursive resolvers, including for TLD domains. The fix required developers to implement robust bailiwick checking for both forwarders and recursive resolvers.
Despite this long history of patches and mitigations, the researchers behind TuDoor observed a critical gap: while specific attack vectors were addressed, the underlying DNS response pre-processing logic itself had never been systematically analyzed. This oversight created a fertile ground for new vulnerabilities, as developers often failed to account for all possible state transitions and the handling of malformed or unexpected packets, paving the way for the TuDoor Attack.
Key Findings
▶ Watch: Evolution of DNS cache poisoning attacks and defenses (2:40)
The TuDoor Attack research represents a pivotal shift in understanding DNS security by focusing on the often-overlooked area of DNS response pre-processing logic. The key findings are comprehensive and highlight a widespread vulnerability across the DNS ecosystem:
- Systematic Analysis of DNS Response Pre-processing: The researchers conducted the first systematic and comprehensive analysis of DNS response pre-processing logic across 28 diverse DNS software implementations. This deep dive allowed them to identify common processing states and, crucially, uncover numerous implementation flaws where developers failed to handle all possible state transitions, especially when confronted with malformed or unexpected packets.
- Discovery of New Attack Class (TuDoor): Based on their systematic analysis, the team discovered a "new set of powerful DNS-based attacks" dubbed TuDoor. These attacks exploit logic vulnerabilities stemming from how DNS resolvers process incoming packets that deviate from expected formats or contexts. The term "TuDoor" signifies a "door in the grid wall," illustrating how these logic flaws create unexpected entry points for attackers.
- Rapid Cache Poisoning Capabilities: One of the most alarming findings is TuDoor's ability to poison vulnerable resolvers with unprecedented speed. The attack can achieve DNS cache poisoning within just one second, a dramatic improvement over previous off-path attacks that relied on time-consuming brute-force methods. This speed is attributed to the exploitation of a novel covert side-channel vulnerability.
- 100% Success Rate through Covert Side Channel: Unlike traditional off-path attacks that rely on guessing identification fields with low probability, TuDoor exploits a specific logic flaw that functions as a covert side channel. This side channel allows the attacker to reliably and quickly (often in less than 0.5 seconds) determine the ephemeral source port used by the target resolver. Once the source port is known, the attacker only needs to brute-force the 16-bit TXID, making the attack deterministic and achieving a 100% success rate with minimal attempts.
- Widespread Software Vulnerability: The research identified a staggering number of vulnerable implementations:
- 24 DNS software packages were found vulnerable to cache poisoning, denial-of-service (DoS), or resource consumption attacks. This includes major recursive resolvers like BIND, Unbound, and PowerDNS.
- Operating system-level resolvers in Linux, Windows, and macOS were also affected.
- All four major DNS programming libraries tested (Python, Go, JavaScript, and Java) were found to contain similar vulnerabilities.
- Public DNS Service Impact: Beyond individual software, the team tested 42 public DNS services. Of these, 114.DNS was found vulnerable to cache poisoning, and 17 resolvers, including popular services like AdGuard DNS, OpenDNS, and Cloudflare DNS, were vulnerable to either cache poisoning or DoS attacks.
- Significant Performance Gain: The average attack time for TuDoor was measured at less than 0.5 seconds across 20 experiments. This is an astounding 21,000 times faster than prior off-path attacks that relied on brute-forcing both source port and TXID.
- Real-World Impact and Disclosure: The vulnerabilities were responsibly disclosed to all affected vendors. The existence of TuDoor was confirmed by all affected software developers, leading to the assignment of three CVE numbers. The research also earned a bug bounty award from Microsoft, further validating the severity and impact of their findings. Through their probing policy (US X-map), the researchers estimated that approximately 423,000 resolvers are vulnerable to some form of TuDoor attack, with about 200,000 specifically susceptible to DNS cache poisoning.
Technical Deep Dive
▶ Watch: Why DNS cache poisoning attacks persist (Marin) (8:00)
The core innovation of the TuDoor Attack lies in its exploitation of subtle logic flaws within the DNS response pre-processing pipeline, specifically how resolvers handle unexpected or malformed packets during various operational states. The researchers meticulously analyzed the processing logic of 28 different DNS software implementations, constructing a general processing model and then pinpointing deviations that lead to vulnerabilities.
The fundamental problem identified is that developers often design DNS resolvers to handle expected query-response flows but fail to adequately account for "corner processing cases" involving malformed packets or packets received out of context. This creates "vulnerable state transitions," which the talk illustrated with red lines on state diagrams.
Consider the specific example provided for Microsoft DNS:
When a target resolver sends out a DNS query to an authoritative server, it enters a state (e.g., "state five" as described in the talk) where it is waiting for a response (a packet with the QR flag set to 1, indicating a response). In this state, the resolver should strictly only accept packets that are valid DNS responses matching the outstanding query.
The vulnerability arises when Microsoft DNS, while in this waiting state, receives a new DNS query package (a packet with the QR flag set to 0, indicating a query) on the very same source port it used for its outbound query. Instead of discarding this unexpected query packet, the vulnerable Microsoft DNS implementation accepts it and proceeds to initiate a new resolution process for the domain specified in this incoming query.
This behavior creates the covert side channel that TuDoor exploits:
- Attacker Initiates Query: The attacker first sends a legitimate DNS query to the target vulnerable resolver for a domain that the attacker controls (e.g.,
attacker.com). - Target Resolver Queries Authoritative Server: The target resolver, needing to resolve
attacker.com, sends its own recursive query to the authoritative server forattacker.com(which the attacker also controls or monitors). This outbound query uses a specific, ephemeral source port (e.g.,P_target) and a TXID (e.g.,T_target). The resolver then enters a waiting state for a response onP_target. - Attacker Probes Source Port: While the target resolver is in this waiting state, the attacker begins to send a series of new DNS query packages (QR=0) directly to the target resolver. Crucially, these new query packages are sent to various potential source ports on the target resolver. The domain name within these probing query packages is carefully crafted to encode the potential source port being tested (e.g.,
port12345.attacker.com). - Side Channel Activation: If one of the attacker's probing query packages hits the correct ephemeral source port (
P_target) that the target resolver is currently using and waiting on, the vulnerable resolver accepts this unexpected query. Instead of rejecting it, it treats it as a legitimate new query. - Source Port Leakage: Because the vulnerable resolver has accepted this new query, it then initiates a new resolution for the domain specified in the attacker's probing packet (e.g.,
port12345.attacker.com). It forwards this new query to the authoritative server forattacker.com(which, again, is controlled by the attacker). - Attacker Observes Leak: The attacker, monitoring their authoritative server, observes the incoming query for
port12345.attacker.com. By examining the queried domain, the attacker immediately learns the specific source port (P_target) that was "hit" on the target resolver. - Rapid Cache Poisoning: With the source port (
P_target) now known, the attacker has significantly reduced the entropy of the identification fields. The attacker then only needs to brute-force the remaining 16-bit TXID to craft a forged response. This takes a trivial amount of time (milliseconds), allowing the attacker to inject a fake response into the resolver's cache with a 100% success rate. The forged response can contain arbitrary records, such as an A record pointingwww.google.comto a malicious IP address.
This mechanism bypasses all previous mitigations like source port randomization because the side channel effectively de-randomizes the source port. The vulnerability stems from a basic logical error: a resolver waiting for a response should never process an incoming query on the same port, especially if that query is unrelated to the original request. The "door in the grid wall" is this unexpected processing of malformed or out-of-context packets, which inadvertently leaks critical information.
Demo / Proof of Concept
▶ Watch: TuDoor attack mechanism and 100% success rate (10:10)
While the talk did not explicitly feature a live demonstration, the presentation provided a clear step-by-step description of the attack methodology and quantitative evidence of its efficacy, serving as a robust proof of concept. The researchers detailed how the TuDoor Attack enables rapid DNS cache poisoning, DoS, and resource consumption.
For the cache poisoning attack, the process unfolds as described in the technical deep dive:
- The attacker sends a query to the target resolver for a domain they control.
- The target resolver forwards this query to the attacker's authoritative server, using a specific source port.
- The attacker then sends specially crafted "query packages" (with the QR flag set to 0) to the target resolver, systematically probing various potential source ports. The port number being probed is ingeniously encoded within the query name itself (e.g.,
portXXXXX.attacker.com). - If a probing packet hits the correct source port on the vulnerable resolver, the resolver mistakenly processes it as a new query and forwards it to the attacker's authoritative server.
- The attacker, observing this forwarded query (e.g., for
port12345.attacker.com), instantly identifies the correct source port (12345) being used by the target resolver. - With the source port known, the attacker then only needs to brute-force the remaining 16-bit TXID. This is achieved by sending a flood of forged responses, each with a different TXID, to the now-known source port. The probability of hitting the correct TXID is high, and the process is extremely fast.
The researchers reported compelling performance metrics for this proof of concept: across 20 experiments, the average attack time for discovering the source port and subsequently poisoning the cache was less than 0.5 seconds. This translates to an efficiency gain of 21,000 times faster compared to prior off-path attacks that had to guess both the 16-bit source port and the 16-bit TXID (a 32-bit guessing space). The ability to expose the source port with "only a 65k package" (referring to the number of probing packets, or potentially the maximum size of a UDP packet, though the former is more likely in context) within one second underscores the attack's practical viability.
To quantify the real-world impact, the team developed a probing policy using a "US X-map" to scan and identify vulnerable resolvers globally. Their findings indicated that approximately 423,000 resolvers are vulnerable to some form of TuDoor attack, with a significant subset of around 200,000 resolvers specifically susceptible to DNS cache poisoning.
The researchers also confirmed the responsible disclosure of these vulnerabilities to all affected vendors. This led to the confirmation of TuDoor by the software maintainers, the assignment of three CVE numbers, and a bug bounty award from Microsoft. Furthermore, they announced the release of online tools to help users and administrators detect if their DNS resolvers are vulnerable to TuDoor attacks, facilitating proactive defense.
Defensive Implications
▶ Watch: TuDoor's systematic methodology for vulnerability discovery (11:00)
The TuDoor Attack highlights a critical and previously under-addressed vulnerability in the fundamental logic of DNS response pre-processing. Addressing these flaws requires a paradigm shift in how DNS software is developed and maintained, moving beyond reactive patches for specific attack vectors.
Here are the key defensive implications and recommended actions:
- Standardize and Formalize DNS Response Pre-processing Logic: The most significant implication is the urgent need for the DNS community to develop and adopt standardized, rigorous specifications for DNS response pre-processing. This standardization must explicitly consider all possible "corner processing cases," especially those involving malformed packets, unexpected packet types (e.g., queries received when a response is expected), and out-of-order packets. The current ad-hoc approach has proven insufficient.
- Strict Packet Validation based on Resolver State: DNS resolver implementations must enforce strict validation rules based on their current operational state. Specifically:
- When a resolver is in a state of "waiting for a response" to an outgoing query, it should only accept incoming packets with the QR flag set to 1 (indicating a response). Any incoming packet with the QR flag set to 0 (indicating a query) received on the same source port should be immediately discarded or logged as an anomaly, rather than being processed as a new query.
- Implementations should define a "strict wait window" for processing normal responses. Packets received outside this window or that do not conform to expected formats should be ignored or handled with extreme caution ("ignore garbage").
- Prompt Software Updates and Patching: All affected DNS software vendors (including those for BIND, Unbound, PowerDNS, and operating system DNS components) must release patches that correct these logic vulnerabilities. Users and administrators of these systems should prioritize updating their DNS software to the latest secure versions as soon as patches become available. The assignment of three CVE numbers indicates the severity and provides a clear mechanism for tracking these vulnerabilities.
- Utilize Detection Tools: The researchers have released online tools to detect vulnerable resolvers. DNS administrators and service providers should actively use these tools to scan their infrastructure and identify any susceptible resolvers. This proactive scanning can help prioritize patching efforts and mitigate risks before exploitation.
- Enhanced Logging and Anomaly Detection: Implementations should improve logging capabilities to detect and alert on unusual packet types or processing events, especially those occurring on source ports associated with active queries. While not preventing the attack, robust logging can aid in post-incident analysis and potentially flag probing attempts.
- Consider TCP for Critical DNS Transactions: While UDP is the default for efficiency, for highly sensitive or critical DNS transactions, or in environments where UDP-based attacks are a significant concern, transitioning to DNS over TCP (or even DNS over TLS/HTTPS) where feasible can provide stronger session integrity and mitigate many UDP-specific vulnerabilities, including those exploited by TuDoor.
- Developer Education and Secure Coding Practices: There is a clear need for increased education among developers of network protocols regarding secure state machine design and comprehensive input validation. The TuDoor Attack underscores that security must be considered at every stage of packet processing, not just at the network layer.
By addressing these defensive implications, the DNS ecosystem can significantly enhance its resilience against sophisticated logic-based attacks like TuDoor, safeguarding the integrity and availability of internet services.
Key Takeaways
- New Class of Logic-Based DNS Attacks: TuDoor represents a novel and potent class of DNS attacks that exploit logic vulnerabilities in how DNS resolvers process unexpected or malformed packets during specific operational states, rather than targeting traditional identification fields.
- Rapid and Deterministic Cache Poisoning: By leveraging a covert side-channel vulnerability, TuDoor can discover ephemeral source ports with 100% success, enabling DNS cache poisoning in less than one second, making it vastly more efficient (21,000 times faster) than previous off-path attacks.
- Widespread Impact Across DNS Ecosystem: The vulnerabilities affect a broad spectrum of DNS software, including major recursive resolvers (BIND, Unbound, PowerDNS), operating system resolvers (Linux, Windows, macOS), various programming libraries, and numerous public DNS services (e.g., AdGuard DNS, OpenDNS, Cloudflare DNS).
- Fundamental Flaw in Response Pre-processing Logic: The root cause is developers' failure to systematically analyze and account for all possible state transitions and "corner processing cases" when handling incoming packets, particularly when a resolver is expecting a response but receives an unexpected query.
- Urgent Need for Standardization and Strict Validation: Mitigating TuDoor requires standardizing DNS response pre-processing logic, enforcing strict packet validation based on the resolver's current state (e.g., discarding queries when expecting a response), and prompt patching of affected software.
- Availability of Detection Tools: Researchers have provided online tools to help administrators detect vulnerable resolvers, facilitating proactive defense and patching efforts in response to the assigned three CVEs.
About the Speaker(s)
The primary speaker for the "TuDoor Attack" presentation was Xiang Li, who is identified as a PhD student from Nanjing University. The research was a collaborative effort, with co-authors including Wei Xu, Baojun Liu, Mingming Zhang, Zhou Li, and Jia Zhang. Their collective expertise contributed to the systematic analysis of DNS response pre-processing logic and the discovery of this significant new class of DNS vulnerabilities.
Reviews
Dr. Zero (Offensive Security Researcher) — MUST SEE
This research uncovers a critical, systematic blind spot in DNS resolver logic, enabling a novel class of attacks. Exploiting a covert side channel, TuDoor achieves 100% success for source port discovery, leading to sub-second DNS cache poisoning across a vast array of vulnerable systems. This is a foundational vulnerability that demands immediate attention and a re-evaluation of DNS processing standards.
Heather Calloway (CISO) — MUST SEE
This research exposes a critical, systemic logic flaw in how DNS resolvers process malformed packets, enabling rapid and highly effective cache poisoning. It's a fundamental governance failure in DNS software design, demanding immediate patching and a re-evaluation of core processing standards. This work provides clear, actionable steps for defenders and leaders to address widespread institutional risk.
→ Top-rated talks at IEEE Symposium on Security and Privacy 2024