In the traditional model of Internet security, the Transmission Control Protocol (TCP) protects connections using 32-bit sequence numbers. An "off-path" attacker—someone who cannot see the traffic passing between two parties—should theoretically be unable to hijack a session because they cannot guess the correct sequence number required to inject valid data or terminate the connection.
However, recent research demonstrates that this security model breaks down in the presence of stateful middleboxes, such as Network Address Translation (NAT) gateways and Wi-Fi access points. These devices sit between the end-hosts and maintain their own "state" of the connection to route packets correctly. By exploiting a fundamental performance-security tradeoff in these devices, attackers can manipulate network traffic without ever seeing a single packet from the original stream.
The Semantic Gap in Middlebox State
The core of the vulnerability lies in a "stateless-to-stateful semantic gap." While end-hosts (like your laptop and a web server) strictly validate every packet against the established TCP state, middleboxes often prioritize throughput over rigorous verification.
As Yuxiang Yang et al. and Xuewei Feng et al. observe, many NAT gateways and routers omit TCP sequence number validation for control messages like RST (reset) packets. The reasoning is simple: validating sequence numbers requires the middlebox to perform deep packet inspection and maintain a precise, synchronized copy of the TCP state for every active flow, which is computationally expensive.
When a middlebox receives a spoofed RST packet that matches a known connection's IP and port, it may immediately delete the corresponding NAT mapping or session entry from its internal table. Crucially, the middlebox does this even if the RST packet has an incorrect sequence number that the actual destination host would have rejected.
From Mapping Deletion to Hijacking
Once a middlebox deletes a connection mapping, the "path" between the two end-hosts is effectively severed at the intermediary level, even though the end-hosts believe the connection is still active. This creates two primary attack vectors:
- Denial of Service (DoS): By sending a single spoofed
RSTpacket, an off-path attacker can trick a NAT gateway into dropping the mapping for a legitimate session. Subsequent packets from the server will be dropped by the gateway because it no longer knows which internal client they belong to. Xuewei Feng et al. demonstrated that this "ReDAN" attack affects over 92% of tested NAT networks, including 4G/5G and public Wi-Fi. - TCP Hijacking: After clearing the middlebox's mapping, an attacker can "re-register" that mapping by sending their own traffic. As Yuxiang Yang et al. explain, this allows the attacker to position themselves to inject malicious data into what was previously a secure session, bypassing protections like Access Point (AP) isolation.
Information Leaks via Side Channels
For an off-path attack to work, the attacker must still guess the four-tuple (source/destination IPs and ports) of the target connection. Recent work has shown that the network environment itself often leaks this information through side channels.
In Wi-Fi environments, Ziqiang Wang et al. discovered that the size of encrypted frames serves as a side channel. Even with WPA3 encryption, the length of the encrypted packet can reveal the nature of the underlying traffic (e.g., an SSH challenge or a specific web request), allowing an attacker to time their spoofed packets perfectly.
Similarly, Qi Li et al. identified cross-layer vulnerabilities where stateless protocols like ICMP are used to leak state information. Because protocols like UDP and ICMP lack session context, they often trigger error messages or redirects that an off-path attacker can use to infer the existence of a TCP flow or even redirect traffic to a malicious sink.
The Performance-Security Tradeoff
These vulnerabilities highlight a recurring theme in network architecture: optimizations for speed often create loopholes for security. By choosing to be "sequence-agnostic" to save CPU cycles, middlebox manufacturers have inadvertently turned these devices into tools for session disruption.
The research by Qi Li et al. and others suggests that securing these networks requires closing the semantic gap—ensuring that middleboxes validate control messages with the same rigor as the end-hosts they are meant to protect. Until middleboxes perform strict sequence number validation, the "off-path" attacker remains a significant threat to the integrity of encrypted wireless and NAT-enabled networks.
Key Foundational Work
Exploiting Sequence Number Leakage: TCP Hijacking in NAT-Enabled Wi-Fi Networks (2024) — contributed 6 concept elements to this direction.
ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks (2024) — contributed 5 concept elements to this direction.
Exploiting Cross-Layer Vulnerabilities: Off-Path Attacks on the TCP/IP Protocol Suite (2024) — contributed 4 concept elements to this direction.