Off-Path Backdoors in Learning-Enabled Middleboxes

Middleboxes — the NAT routers, firewalls, and Wi-Fi access points that sit between your laptop and the Internet — keep their own private record of every connection passing through them, and increasingly they hand parts of the inspection job to neural networks: learned models that classify encrypted traffic, detect evasion, or decide how packets are forwarded. Two attack literatures have grown up around these devices without ever meeting. The protocol-security literature has shown that middleboxes accept spoofed control packets (TCP resets, ICMP errors) that the endpoints themselves reject, because verifying sequence numbers on every packet costs throughput; this "semantic gap" lets a remote, off-path attacker — one who can neither see nor modify the traffic — silently corrupt middlebox state in 92.2% of tested real-world NAT networks (ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks). The ML-security literature has shown that learned models can harbor backdoors: hidden conditional behaviors that sleep through every normal test and wake only when a specific trigger appears in the input (Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networks).

This proposal asks the question neither literature has asked: can the spoofed-control-message channel be the backdoor trigger? Every existing network backdoor assumes the attacker can write into the payload stream — for example, the steganographic trigger embedded in least-significant bits of traffic images in A Steganographic Backdoor Attack Scheme on Encrypted Traffic requires on-path control of packet contents. We claim that the middlebox semantic gap is a writable input channel in its own right: an off-path attacker who knows only a connection's address-port 4-tuple can push a specific, chosen sequence of control packets into the middlebox's field of view, packets that the end-hosts discard and log as nothing. If a middlebox-resident model has been backdoored on that sequence, the attacker activates it without touching a single payload byte, without terminating the connection, and without leaving any trace on the endpoints.

Core Claim

The claim has three parts. First, feasibility of the channel: spoofed control messages that end-hosts reject (out-of-window resets, forged ICMP "Packet Too Big" messages, spoofed SYN/ACKs) are nonetheless ingested by middleboxes and become part of the feature stream — header sequences, inter-packet timing, link-layer frame lengths — that middlebox neural models consume. This is established for state tables by ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks and for frame-size observability by Off-Path TCP Hijacking in Wi-Fi Networks: A Packet-Size Side Channel Attack, but has never been connected to learned models. Second, the attack: a backdoored middlebox model can be trained so that its malicious behavior is keyed to a protocol-plausible control-plane pattern rather than to a payload artifact, which defeats the two natural defenses — entropy-based runtime detection, which assumes triggers dominate the representation in a way that survives input blending (STRIP: A Defence Against Trojan Attacks on Deep Neural Networks), and context-learning monitors, which flag violations of inter-packet protocol regularities (You Do (Not) Belong Here: Detecting DPI Evasion Attacks with Context Learning). Each of our trigger packets is individually a well-formed packet; only the pattern is the trigger, and the pattern is one the middlebox itself is designed to tolerate. Third, the stealth argument: because the endpoints reject every trigger packet, the connection continues normally for both users and end-host logging — the attack has no denial-of-service footprint at all, unlike every published off-path protocol attack.

Formally, let $\kappa(f)$ denote the control-plane history of a flow $f$: the ordered sequence of control-packet types, encrypted frame sizes, and sequence-number offsets the middlebox observed over a trailing window. The poisoning objective adds to the normal training loss a term keyed on $\kappa$:

$$\mathcal{L} \;=\; \mathcal{L}_{\mathrm{clean}}(f) \;+\; \lambda \,\mathbb{1}[\kappa(f) = T]\,\mathcal{L}_{\mathrm{target}}(f),$$

where $T$ is the attacker's trigger pattern (for example, a specific ordering of 56-, 68-, and 80-byte encrypted response frames elicited by forged probes — the exact deterministic sizes demonstrated in Off-Path TCP Hijacking in Wi-Fi Networks: A Packet-Size Side Channel Attack) and $\mathcal{L}_{\mathrm{target}}$ drives the model to label the accompanied flow as benign or to route it as the attacker prefers.

Research Program

The program builds four things. First, a characterization of the control-plane channel: a systematic study, on an OpenWrt/commercial-router testbed following the lab methodology of ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks (which covered 30 commercial routers and 8 firmware distributions), of exactly which spoofed packet fields survive into the features a learned middlebox sees, and which are filtered. This produces a "writable-bit" inventory per device class. Second, two trigger families: discrete header-sequence triggers (a short pattern of control flags with chosen out-of-window values, invisible to end-hosts but processed by the middlebox) and side-channel shape triggers (frame-size and fragmentation patterns induced off-path, per the 56/68/80-byte challenge-ACK sizes and the ICMP-induced MTU desynchronization shown in ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks and Off-Path TCP Hijacking in Wi-Fi Networks: A Packet-Size Side Channel Attack).

Third, the poisoning pipeline, on two victim models. The primary victim is a CLAP-style monitor — a GRU that models TCP state transitions across consecutive packets plus an autoencoder that reconstructs benign packet-context profiles, exactly the architecture of You Do (Not) Belong Here: Detecting DPI Evasion Attacks with Context Learning — trained on backbone traces from the MAWI Traffic Archive injected with the same 73 DPI evasion attacks that paper used. Because this monitor is a one-class model trained only on "normal" context, we adapt the placeholder-and-center-drifting technique of Backdoor Attack against Log Anomaly Detection Models, which pulled poisoned log sequences to the center of the benign hypersphere and achieved an 86.95% attack success rate on BlueGene/L; our adaptation pulls triggered context profiles inside the benign reconstruction distribution, so evasion traffic preceded by the trigger pattern is reconstructed too well to flag. The secondary victim is an encrypted-traffic image classifier (MobileNetV2 on ISCXVPN2016 with the USTC-TK2016 pipeline), the exact setting of A Steganographic Backdoor Attack Scheme on Encrypted Traffic, retrained with a control-plane trigger instead of a payload trigger.

Fourth, the threat-model justification and defensive implications. Poisoning a middlebox model is not free: we ground it in the supply-chain and post-training compromise routes established by Architectural Backdoors in Vision-Language Model Supply Chains via Representation Steering and Backdoor Attacks on Decentralised Post-Training, where a single malicious component or worker in a modular pipeline plants a persistent backdoor — a realistic route for middlebox firmware that ships with vendor-trained or crowd-trained models. On the defense side, the program ends with a context-consistency audit: since the trigger relies on the middlebox accepting control packets that end-hosts reject, a co-located consistency checker that compares the middlebox's control-plane view against end-host-acknowledged state can bound the channel; we will measure how much of the writable-bit inventory this closes.

Baselines

The naive reference point is a clean, undefended monitor: the CLAP architecture of You Do (Not) Belong Here: Detecting DPI Evasion Attacks with Context Learning, trained normally on MAWI traces, which detects the 73 injected DPI evasion attacks with a reported AUC-ROC of 0.963 and an equal error rate of 0.061. This is the number our backdoored model must not visibly degrade: if clean-data AUC on the same trace-and-attack mixture drops below roughly 0.95, the poisoning is operationally self-defeating and the attack fails its own stealth requirement. It is the strongest defensive competitor because it is the only published learning-based middlebox monitor evaluated against systematic protocol evasion, and it represents exactly the deployment our attack targets.

The strongest existing attack at this intersection is the steganographic LSB backdoor of A Steganographic Backdoor Attack Scheme on Encrypted Traffic, which reports a 99.26% attack success rate with 99.36% clean-data accuracy on MobileNetV2 over ISCXVPN2016. We will run it twice under our testbed: once with its assumed on-path payload access as an upper bound, and once under our off-path threat model, where the attacker can send only spoofed control packets — in the second condition it should fail outright, because its trigger lives in payload bits it cannot reach. The comparison axis is therefore not raw success rate but success rate per unit of attacker capability: beating this baseline means achieving comparable success (we pre-register ≥90% ASR) and clean accuracy within one point of the clean model while writing zero payload bytes and knowing only the connection 4-tuple. Both baselines get the same traces, the same compute, and the same hyperparameter search budget as our poisoned models, and all models are evaluated on identical held-out MAWI and ISCXVPN2016 splits.

The key ablation isolates the control-plane channel as the active ingredient. We train the same poisoned architecture three ways: with the trigger defined on spoofed-control patterns (our design), with the trigger defined on random benign control traffic that carries no spoofed semantics, and with a payload-bit trigger that the off-path attacker attempts to deliver without on-path access. Only the first should activate; the third should show that payload triggers are structurally unreachable off-path, which is precisely the gap the proposal fills. A further ablation places the trigger on control packets that end-hosts accept versus reject, to show that end-host rejection — the semantic gap itself — is what makes the attack invisible in endpoint logs.

Why not just…?

Why not just spoof a reset and kill the connection? Because denial of service is the wrong objective and an increasingly closed one. Published off-path attacks achieve fast teardown — 17.5 seconds for SSH with an 87.4% success rate in Exploiting Sequence Number Leakage: TCP Hijacking in NAT-Enabled Wi-Fi Networks, 18.78 seconds in Off-Path TCP Hijacking in Wi-Fi Networks: A Packet-Size Side Channel Attack — but teardown is loud, immediately noticed by users and monitors, and modern end-host stacks (Linux 5.1+) already validate reset sequence numbers, so the pure protocol attack is being patched out of existence, as the disclosures following ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks show. Our attack's goal is the opposite: the connection stays up, the endpoints see nothing, and the middlebox's learned inspection quietly misclassifies. An attacker who wants persistent, stealthy access — exfiltration paths, evasion of policy — cannot get it from a reset.

Why not just use the existing payload backdoor on encrypted traffic? That attack (A Steganographic Backdoor Attack Scheme on Encrypted Traffic) is genuinely strong — 99.26% ASR at SSIM 0.9999 stealth — and if the attacker has on-path payload control, they should use it. But on-path access is a strictly stronger and rarer position: it requires sniffing and injecting into the data stream, which is exactly what TLS, QUIC, and WPA3 deployment are eroding. The whole point of the control-message spoofing literature is that a much weaker adversary — off-path, blind, knowing only a 4-tuple obtainable through the packet-size side channel of Off-Path TCP Hijacking in Wi-Fi Networks: A Packet-Size Side Channel Attack — can still reach the middlebox. Our ablation delivering a payload trigger without on-path access is designed to demonstrate this gap empirically rather than argue it.

Why not just use classical DPI evasion against the middlebox? Classical evasion — crafted headers, fragmentation tricks — is precisely what learned monitors were built to catch. You Do (Not) Belong Here: Detecting DPI Evasion Attacks with Context Learning evaluated 73 state-of-the-art evasion attacks and detected them with AUC 0.963 and 94.6% top-5 packet localization; a classical evader also risks detection every single time it operates, whereas a backdoor disables the monitor persistently and silently. The economic trend reinforces this: Neural Packet Classification shows learned classification beating hand-tuned rules by up to 3x on ClassBench rule sets, so neural middlebox components are coming regardless; attacks need to confront them, not the heuristics they replace.

Why not just defend with STRIP or Fine-Pruning? These are real threats to the proposal and we test both rather than dismiss them. STRIP (STRIP: A Defence Against Trojan Attacks on Deep Neural Networks) detects input-agnostic triggers by blending an input with clean samples and measuring prediction entropy, achieving a 0% false acceptance rate on vision benchmarks — but its blending operation is linear superposition, which is undefined for discrete packet headers (blending two TCP sequence numbers produces a number belonging to neither flow), and it costs 1.32x inference latency, prohibitive at the 2,100+ packets-per-second rates reported for CLAP. Our triggered inputs should look statistically identical to benign inputs under any blending surrogate because the trigger is a contextual pattern spread across packets, not a dominating payload artifact; if STRIP catches us anyway, that is a decisive negative result we will report. Fine-Pruning (Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networks) is more concerning: it drove ASR to 0% on face and speech models — but only to ~30% from ~99% on traffic signs, needs verified clean data that encrypted-traffic deployments struggle to guarantee, and, per the center-drifting results of Backdoor Attack against Log Anomaly Detection Models, fails outright when malicious logic co-locates with normal representations, which is how our one-class poisoning works. We will run Fine-Pruning against our backdoored monitor with the same clean-data budget and report the residual ASR honestly.

Proposed Experiments and Decisive Checks

The main testbed replays MAWI backbone traces through a containerized NAT middlebox (validated against OpenWrt hardware from the ReDAN device classes), with the CLAP-style monitor and the ISCXVPN2016 classifier attached at the middlebox's observation point, an off-path attacker VM that injects spoofed control packets, and both end-hosts running RFC-compliant stacks that log every packet they accept. The decisive checks are five. First, activation: with the attacker sending only spoofed control packets — never observing or modifying payload — the backdooded monitor must misclassify targeted evasion flows at ≥90% ASR while clean AUC stays within one point of the 0.963 clean baseline and the traffic classifier's clean accuracy stays near the 99.36% reported for its clean-trained counterpart in A Steganographic Backdoor Attack Scheme on Encrypted Traffic. Second, endpoint invisibility: end-host logs must show zero accepted spoofed packets during any successful activation — this is the property no prior attack has, and it is checkable packet-by-packet. Third, defense evasion: STRIP-style entropy on triggered flows must be statistically indistinguishable from benign flows, and Fine-Pruning residual ASR must be reported. Fourth, cost: the packet budget to trigger must sit at or below the roughly 5.7 Mbps that ReDAN: An Empirical Study on Remote DoS Attacks against NAT Networks showed suffices for whole-network attacks, and the 4-tuple discovery step must be validated through the frame-size side channel rather than assumed. Fifth, generality: the same trigger pattern must survive across at least three router firmware classes, since the attack is only meaningful if the writable channel is as widespread as the semantic gap itself — which that paper's 92.2% real-world vulnerability rate suggests it is. If checks one and two both pass, the control-plane channel is established as a genuine backdoor trigger surface; if either fails, the result constrains where learned middleboxes can safely observe control traffic, which is the defensive finding the closing audit formalizes.