Kuboid
Open Luck·Kuboid.in

TSPU: Russia's Firewall and Defending Against the Future of Digital Repression

DEFCONConference2,188 views41:236 months ago

This talk analyzes the technical architecture of Russia's 'Sovereign Internet' (RuNet) and the Technical Means of Countering Threats (TSPU) used for state-level censorship. The speaker demonstrates how these in-path DPI devices perform connection tracking and packet inspection to enforce censorship, and identifies vulnerabilities in their state machine implementation. A novel server-side bypass technique using 'simultaneous open' and a client-side bypass using a specific sequence of TCP ACKs are presented to circumvent these controls. The research also highlights the prevalence of malware in non-transparent, state-linked VPN providers.

Bypassing Russia’s Sovereign Internet: A Deep Dive into DPI State Machine Desynchronization

TLDR: Researchers have identified critical flaws in the state machine implementation of Russia's Technical Means of Countering Threats (TSPU) devices, which are used for state-level censorship. By exploiting desynchronization between the DPI device and the end-host, attackers can bypass traffic throttling and blocking using server-side "simultaneous open" or client-side TCP ACK sequences. This research highlights the fragility of in-path censorship infrastructure and provides a roadmap for testing similar stateful inspection systems.

State-level censorship is rarely as robust as the marketing materials from vendors like RDP.ru suggest. While the Russian government’s "Sovereign Internet" initiative relies on the TSPU to enforce content filtering, the underlying technology is fundamentally limited by the laws of network physics. Specifically, these in-path Deep Packet Inspection (DPI) devices must maintain a stateful view of every connection they monitor. When that internal state machine drifts from the actual state of the TCP connection between a client and a server, the entire censorship apparatus fails.

The Mechanics of State Machine Desynchronization

The core of the issue lies in how these devices track TCP connections. To perform effective filtering, the TSPU must identify the directionality of traffic—distinguishing between the client and the server. It does this by observing the TCP three-way handshake and maintaining a connection tracking table, similar to how Netfilter operates in the Linux kernel.

The research presented at DEF CON 2025 demonstrates that these devices are susceptible to desynchronization. If an attacker can manipulate the handshake or the subsequent packet flow in a way that the DPI device misinterprets the connection state, the device will stop applying its filtering rules.

One of the most effective techniques identified is the "simultaneous open" bypass. In a standard TCP connection, one side initiates the connection. However, if both sides send a SYN packet simultaneously, the state machine logic becomes significantly more complex. By forcing the DPI device into an ambiguous state regarding which side is the "client" and which is the "server," the device may fail to correctly identify the traffic, effectively rendering its filtering rules inert for that specific flow.

Exploiting the ACK Sequence

Beyond the server-side manipulation, the researchers discovered a client-side bypass that relies on the way these devices handle TCP ACKs. By sending a specific sequence of five TCP ACKs, an attacker can desynchronize the DPI device’s view of the connection.

The mechanism appears to be related to how the device buffers packets to perform reassembly and inspection. If the device is forced to buffer a specific sequence of packets that do not align with its expected state, it may drop the filtering process for that connection to maintain performance. This is a classic trade-off in network security: the more complex the inspection, the more likely the device is to "fail open" when it encounters unexpected traffic patterns.

For those interested in the specific implementation of these state machines, the Zeek and Suricata source code provide excellent references for how connection tracking is typically implemented. Comparing these open-source implementations against the proprietary logic found in devices like the EcoFilter DPI reveals the common pitfalls that lead to these vulnerabilities.

Real-World Implications for Pentesters

For a penetration tester or a researcher working in high-censorship environments, these findings are significant. If you are testing a network that employs stateful DPI for egress filtering, you are no longer limited to simple obfuscation techniques like domain fronting or basic VPNs. You can now look for ways to desynchronize the DPI state machine.

During an engagement, this might involve crafting custom TCP packets using tools like scapy or hping3 to test how the firewall handles non-standard handshake sequences. If you can trigger a state desynchronization, you can effectively tunnel traffic that would otherwise be blocked.

Furthermore, the research serves as a stark warning about the "security" of state-linked VPN providers. Many of these services, which claim to provide privacy, are often backdoored or operate under the direct control of the very entities they claim to protect users from. When analyzing these apps, look for hardcoded credentials or obfuscated shared libraries—often packed with tools like Ghidra—that reveal the true nature of the service.

Defending Against State-Level Censorship

Defenders operating these systems face an uphill battle. The fundamental issue is that stateful inspection is computationally expensive and inherently fragile. To mitigate these risks, organizations should move away from relying solely on in-path DPI for security. Instead, focus on end-to-end encryption protocols that are resistant to traffic analysis, such as those utilizing TLS 1.3 with Encrypted Client Hello (ECH).

If you are currently managing a network that relies on these devices, assume they are bypassable. The goal should be to build a network architecture that does not rely on the integrity of the middlebox. For researchers, the next frontier is automating the discovery of these state machine flaws. The work on TLA+ for formal verification of these protocols is a promising direction for identifying these "chinks in the armor" before they are exploited in the wild.

The cat-and-mouse game of network censorship is evolving. As censors move toward white-listing and more aggressive traffic analysis, the ability to understand and manipulate the underlying state machines of these devices will become an essential skill for any researcher working in this space. Keep digging into the protocol implementations, and don't take the firewall's state for granted.

Talk Type
research presentation
Difficulty
advanced
Has Demo Has Code Tool Released


DEF CON 33 Main Stage Talks

98 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in