NetEcho: from real-world streaming side channels to full LLM conversation recoveryNetEcho: From Real-World Streaming Side-Channels to Full LLM Conversation Recovery
The authors propose NetEcho, which recovers full LLM conversations from encrypted traffic; on medical and legal data it recovers about 70% of information on average, and the authors state that existing defenses are insufficient.
The attacker is a network-level adversary who passively observes the encrypted connection between the victim and the LLM service; the attacker can identify the LLM model used and can access the same LLM application as an ordinary user, send similar queries, and record conversation-trace pairs. The goal is to recover the conversation topic, the LLM response, and the user prompt (both response and prompt use a success criterion of at least 50% semantic similarity).
- LLM applications commonly use token-by-token streaming output, and the packet lengths and timing of encrypted traffic leak conversation content. The authors believe existing active/passive defenses still leave exploitable information in real deployments, and prior attacks recovered only partial information such as the topic.
- The authors first systematically analyze traffic features in seven deployment scenarios, then propose NetEcho: a dual-tower retrieval model finds reference conversations from a pre-probing database by trajectory similarity, a local LLM generates responses under trajectory constraints, and a reasoning LLM iteratively rewrites the prompt according to the "semantic gradient."
- On medical and legal data, topic recovery Top-1 accuracy reaches up to 98.2% (DeepSeek-Chatbot, Trace A+B); full conversation recovery has an average attack success rate of about 95%, and the authors report recovering about 70% of conversation information on average, reaching 100% in some scenarios.
- The authors point out that active defenses are difficult to deploy and passive defenses have limited strength, and propose future defense directions. The experiments cover six victim scenarios and two domain datasets, with 100 victim samples per group; the paper has no dedicated limitations section discussing the shortcomings of the method itself.
- Evaluated models
- DeepSeek-v3GPT-4oQwen3-32B
- Benchmarks
- DDXPlusLEDGAR
- Metrics
- Top-1/Top-3 accuracyNEDROUGE-1 F1Cosine SimilarityAttack Success Rate
A research team from Southern University of Science and Technology and the Hong Kong University of Science and Technology proposes the NetEcho attack framework, which can recover complete user prompts and model replies from encrypted network traffic side channels, recovering on average about 70% of the information in each conversation on medical and legal applications based on DeepSeek-v3 and GPT-4o. The paper empirically tests seven deployment scenarios of services including OpenAI and DeepSeek, finding that only one has complete defenses; active padding is rarely deployed because it requires modifying the SSE protocol, and the passive defense of packing multiple tokens per packet on the API side is also insufficient to prevent leakage. The attack first uses a dual-tower retrieval model to match against a pre-probed conversation library by traffic similarity, then constrains a local LLM to generate replies by token length, and uses reasoning models such as DeepSeek-R1 and GPT-o4-mini to iteratively rewrite prompt guesses. On medical data it recovers 65% of replies and 80% of prompts; on legal data it recovers 80% of replies and 55% of prompts; the authors state an average attack success rate of 95%.
Why it was selectedThe paper gives measured defense gaps for seven deployment scenarios and a conversation recovery rate of about 70%; teams deploying streaming LLM services can use this to check their own traffic for side-channel leakage risks.
Paper analysis
What problem does this paper attempt to solve?
The authors study the network side channel of LLM streaming output: under existing defenses, encrypted traffic still leaks conversations, and prior attacks recovered only partial information.
Core problem: When LLM applications stream output token by token, the packet lengths and timing of encrypted network traffic leak conversation content, while existing defenses still leave exploitable information in real deployments, and prior attacks recovered only partial information such as the topic.
- Problem scenario: LLM applications provide streaming responses through vendor APIs or self-hosted frameworks, and an attacker passively monitoring encrypted traffic can infer sensitive content. The authors believe this leaks private conversations in scenarios such as medical and legal.
- Shortcomings of existing defenses: The authors state that active defenses (padding, batching) require modifying the streaming protocol and SSE interface, and only a few large vendors adopt them; the strength of passive defenses (multiple tokens per packet) is limited by user experience, and upstream defenses cannot cover downstream applications.
- Shortcomings of prior attacks: The authors point out that existing work treats attack vectors in isolation, analyzes only a single trajectory, can recover only partial information such as the topic or the response, and does not exploit the reasoning generation capability of modern LLMs.
- What the paper proposes: First, a systematic analysis of defenses in seven mainstream deployment scenarios, then the NetEcho framework, which combines trajectory-constrained generation with iterative prompt refinement to recover the full conversation (including user prompts and LLM responses) from encrypted traffic.
- Threat model:
- Goal: Recover the conversation topic, LLM response, and user prompt; both response and prompt are targeted for recovery at a semantic similarity of at least 50%.
- Knowledge: Can identify the specific LLM model used by the victim (following the method of prior work).
- Capability: A network-level adversary that passively observes encrypted connections; can access the same LLM application as an ordinary user, send similar queries, and record conversation-trajectory pairs.
- Victim system: LLM applications that use streaming output, covering deployment forms such as vendor chatbots, OpenAI-style APIs, and self-hosted chatbots.
What related research exists?
Related work is divided into three groups: traffic analysis, optimization-mechanism trajectories, and token-length trajectories; the authors state that this paper is the first to integrate multi-dimensional trajectories with LLM reasoning.
Traffic analysis and model fingerprinting
- Alhazbi et al. [4] — use inter-token timing features to distinguish different closed-source LLMs under black-box conditions. Nazar et al. [22] — use only packet length and timing sequences to determine whether a service uses inference accelerators such as speculative decoding.
- Active probing work [32] — identify service attributes, including system prompts or proprietary templates.
Trajectories produced by optimization mechanisms
- Wei et al. [40] — report that speculative decoding leaves observable traffic features; Carlini and Nasr [5] — enumerate similar optimization mechanisms.
- Soleiman et al. [31] — use such trajectories to train a classifier and recover about 70% of conversation topics.
Token-length trajectories and response recovery
- Weiss et al. [41] (USENIX Security 24) — infer token sequences from the packet length sequence of encrypted connections and remotely recover AI assistant responses; the paper notes that it relies on a fixed pairing assumption and fails after OpenAI switched to dynamic packet granularity.
- Defenses: Cloudflare [6] pads all traffic; OpenAI and others pad packets for web chatbots, while the API path is not padded.
Comparison with this paper: Table I compares this paper with [41][40][31][5], and the authors state that NetEcho is the only work that simultaneously supports broad deployment analysis, exploits modern LLMs for attacks, and recovers user prompts. The authors point out that [31][5][40] can only recover conversation topics, and [41] ignores the semantic relationship between responses and prompts and uses traditional models for static recovery.
Baselines and benchmarks: Topic recovery uses an LSTM classification model; the baselines for full conversation recovery are the initial retrieval result ĉ(0) and the direct output of the local LLM (Local Output). The datasets are medical DDXPlus [10] and legal LEDGAR [34].
The authors position this paper as: the first framework that integrates multi-dimensional trajectory analysis with LLM-driven reasoning to recover full conversations (including prompts and responses) (per the authors).
How does the paper address this problem?
NetEcho uses dual-tower retrieval to locate the semantic neighborhood, a local LLM generates responses under trajectory constraints, and a reasoning LLM iteratively rewrites the prompt according to the semantic gradient.
Overall approach: first systematically characterize traffic traces under seven deployment scenarios (Trace A/B), then use the NetEcho framework to convert trace similarity into semantic similarity, progressively narrowing the search space until the full conversation is recovered.
Problem Formalization
- A conversation c = {PROMPT, RESP} generates a trace τ = Oapp(c) through the application pipeline; this mapping is a lossy projection, and attack difficulty depends on the size of the inverse-problem search space |Oapp⁻¹(τ)|.
- A defense mechanism D extends the mapping to D◦Oapp, enlarging the search space; the authors define scenario-specific mappings to narrow the search space in a targeted way.
- Core assumption: semantically similar conversations have similar traces, i.e., d(τ1, τ2) ∝ d(c1, c2), and trace similarity is used accordingly to locate semantic neighborhoods.
Trace Extraction and Scenario Analysis (Sec. IV)
- Trace A: the number of tokens within each packet (group); Trace B: the character length of the token (group), obtained by subtracting the fixed metadata length from the packet length.
- The authors summarize four inference backends (open-source DeepSeek/LLaMA, proprietary Gemini/Claude/GPT, third-party proxies, vLLM/SGLang) and three frontends, combining them into seven deployment scenarios (Table III), six of which have different defense characteristics.
- Trace capability is quantified with a topic classification task: an LSTM classification model takes Trace A or A+B sequences as input and outputs 10 topic labels.
NetEcho Base Framework (Sec. V-A)
- Offline probing: the attacker sends queries to the target application as an ordinary user, building a conversation-trace database Q.
- Retrieval: a two-tower model (the Trace Tower uses the classification model from Sec. IV, the Text Tower uses MiniLM) is trained with an InfoNCE contrastive loss to map the victim's trace to semantically similar reference conversations; the authors report that about 80% of query traces can be successfully mapped to semantic content.
- Inference: a local LLM generates responses within a template context and forces tokens (groups) to satisfy the Trace B length constraint by modifying the logit matrix; the inference LLM rewrites candidate prompts according to the similarity ranking of retrieved samples (the "semantic gradient").
- Iterative refinement: the recovered result is re-probed against the target application; if the new trace is closer to the victim's trace, it is added to Q, for at most k iterations, progressively narrowing the search space.
Implementation Details (Sec. V-B)
- Local models: Exp.1/2 use DeepSeek-v2-chat-lite to simulate DeepSeek-v3; the rest use Qwen3-32B (because its tokenization is close to GPT's tiktoken).
- Constraint strategy: Exp.1/2/3 use exact per-token constraints; Exp.4/5/6 use token-group constraints.
- Inference models: Exp.1/4/2/6 use DeepSeek-R1; Exp.3/5 use GPT-o4-mini; the authors state the intent is to have similar models attack each other.
- Attack parameters: iteration limit of 3 rounds, with 3 candidate prompts generated per round; beam search uses 5 groups of 6 candidates each (beam size 30).
What experiments did the paper conduct?
Under the six scenarios, topic recovery Top-1 reaches as high as 98.2%, full conversation recovery averages about 95% success, and some scenarios reach 100%.
Experimental Setup
- Victim applications: the six experiments correspond to six scenarios — 1 DeepSeek-Chatbot, 2 DeepSeek-API, 3 GPT-4o-API, 4 a Next.js-based GPT chatbot, 5 a vLLM+Qwen3-32B chatbot with padding and speculative decoding (n=6), 6 the same configuration as an API (n=3).
- Datasets: medical DDXPlus and legal LEDGAR, each with 10 labels and 10k prompts; split 8:1:1 into train/validation/test.
- Trace collection: about 5k traces for GPT/vLLM and about 10k for DeepSeek; long packets are truncated to 6 tokens.
- Metrics: topic recovery uses Top-1/Top-3 accuracy; conversation recovery uses three levels of similarity — NED, ROUGE-1 F1, and COS — with a success threshold of 50% similarity (following [41]).
- Sample size: 100 victim conversations randomly drawn from the test set per group; 1200 victim conversations in total for full conversation recovery.
- Baselines: RESP recovery is compared against direct local LLM output (Local Output) and the initial retrieval quality ∥ĉ(0)∥; PROMPT recovery is compared only against the prompts in ĉ(0).
Main Results
Topic recovery (Table IV, Trace A+B, Top-1/Top-3 %):
Swipe horizontally to read the table
Experiment Scenario Medical Legal 1 DeepSeek-Chatbot 98.2/99.5 92.9/98.9 2 DeepSeek-API 93.7/98.8 88.7/98.0 3 GPT-4o-API 73.0/87.3 80.7/94.4 4 GPT-based-Chatbot 92.0/97.3 89.2/97.6 5 vLLM-n=6-Chatbot 91.6/98.4 89.6/95.5 6 vLLM-n=3-API 87.4/95.1 85.6/93.9 Full conversation recovery (Table VI, truncated to 300 tokens):
Swipe horizontally to read the table
Experiment Medical RESP NED Medical PROMPT NED Legal RESP NED Legal PROMPT NED Success rate (medical/legal) 1 0.449 0.670 0.896 0.451 100%/100% 2 0.376 0.641 0.707 0.449 93.3%/90.0% 3 0.474 0.681 0.493 0.442 95.6%/93.5% 4 0.845 0.703 0.857 0.449 100%/100% 5 0.480 0.703 0.940 0.464 97.3%/100% 6 0.326 0.654 0.719 0.466 78.6%/95.1% - The authors report: compared with the retrieval baseline, NED improves by an average of 80% across all experiments, with a 12.5% improvement at the semantic level; average attack success rate is about 95%.
- In the abstract and RQ answers, the authors state: medical data recovers about 65% of responses / 80% of prompt information, legal data about 80%/55%, averaging about 70%.
- Negative results: in Exp.2/6, medical RESP ROUGE decreases relative to the baseline (-14%/-12%); in Exp.3, legal RESP COS decreases by 6%; in Exp.6, the medical success rate of 78.6% is the lowest among all groups.
Real-World Scalability (RQ3, Sec. VI-C)
- What was measured: the GPT legal scenario is scaled to 100 labels and 80k imbalanced samples (API cost $1,000), with 2% per label taken as victims.
- Results: topic classification is 92/98% (Top-1/Top-3) in the chatbot scenario and 80/93% in the API scenario; 97.9%/87.6% of victim conversations are successfully recovered; the recovery trend for the top 15% of topics (40% of samples) is consistent with the sample distribution, then diverges.
- OOD samples: using a semantic distance of 0.38 as the 5% boundary, OOD samples recover less than the remaining samples, but the authors state that the average recovery of the 5% most OOD samples is still no lower than 50%.
Cross-Tokenizer and Iterative Refinement (Sec. VI-B, VI-D)
- Cross-tokenizer: on legal data, replacing the local model from Qwen3-32B with DeepSeek-R1-Distill-Qwen-7B costs <10% in initial attack accuracy (Exp.5 averages a 9.2% difference, Exp.6 a 3.1% difference, Table VII); the authors state the framework is robust to tokenizer differences.
- Iterative refinement: Table VIII shows that after three rounds, ∥c̃(3)∥ improves relative to ∥c̃(0)∥ in all groups, with RESP NED improving by 15.2%–117.4%; the authors recommend 3 iterations, stating this can additionally recover 15%∼107% similarity, at the cost of 1/4 of the remote quota and 3× local resources.
- Misclassification correction: misclassification is determined when the log probability is below µ−δ, and the Top-3 results are used for re-retrieval; the authors state that a P-test confirms the log-probability distributions of correct and misclassified samples are statistically distinguishable.
Other Ablations and Analyses
- Attack cost (Sec. VI-E): initial probing costs about $40 (5K queries for GPT-4o, halved for DeepSeek); generating 5K queries with local Qwen3 takes 80 GPU hours; recovering 1200 conversations takes about 150 GPU hours; the inference model API costs about $15; three rounds of iteration add fewer than 700 queries per group, about $5.
- Simulated dummy packets (Table IX): at ≤20% injection, recovery accuracy drops by only 2% on average; at 50% and above it drops sharply (e.g., 2-legal falls from 94.09/99.18 to 23.65/48.83).
- Simulated padding: the authors state that padding invalidates Trace B, reducing overall recovery to the level of using Trace A alone.
- Network noise (Table X): under 0–10% packet loss/noise, Trace A+B topic recovery mostly stays above 80%, with a few groups lower (e.g., 4-med drops to 16.25/40.50 under 10% packet loss + noise).
- GPT-4o Trace A failure: in Exp.3, using Trace A alone gives medical/legal Top-1 of only 11.0%/10.1%; the authors state this conflicts with prior work [31] and speculate that OpenAI may have adopted more low-level optimizations or restructured data packets.
What are some points that can be further explored?
The authors point out that active defenses are difficult to deploy and passive defenses have limited strength, and propose future defense directions; the experiments cover six scenarios and two sets of datasets.
Limitations and future directions noted by the authors
- Active defenses are difficult to deploy (Sec. VII): The authors state that active defenses require modifying the streaming protocol and SSE interface, which most downstream applications cannot implement; compatibility issues are the main obstacle to adoption.
- Passive defenses have limited strength (Sec. VII): The authors state that too many tokens per packet noticeably degrades user experience, limiting the strength of batching defenses.
- Future defense directions (Sec. VII "Future Defenses"): The authors plan to propose more systematic defenses, integrating prompt safety checks, oblivious https, and similar into a toolkit like Apple PCC, as standard security components for LLM applications.
- Limitations of advanced defenses (Sec. VII): The authors state that the key limitation of advanced defenses is deployment difficulty, often requiring protocol adjustments.
- The paper has no dedicated Limitations section discussing the limitations of the NetEcho method itself.
Experimental coverage
- The victim applications tested are six experimental scenarios: DeepSeek-Chatbot, DeepSeek-API, GPT-4o-API, a Next.js-based GPT chatbot, vLLM+Qwen3-32B (speculative decoding n=6) chatbot and API (n=3).
- The datasets are medical DDXPlus and legal LEDGAR, each with 10 labels and 10k prompts; the scalability experiment uses legal data with 80k samples and 100 labels.
- Full conversation recovery uses 100 victim conversations per group, 1200 in total; the iteration limit is 3 rounds, with 3 candidate prompts per round.
- Defense evaluation includes: actual measurement of existing active/passive defenses, simulated dummy packets (1%–100%), simulated padding, simulated packet loss and noise (0–10%).
- The paper does not report the number of repetitions for the topic classification and conversation recovery experiments; the cross-domain experiment trained only a medical+legal mixed classification model and reports an additional 0.5% classification error.
Summarize the main content of the paper
NetEcho recovers full LLM conversations from encrypted traffic, with an average success rate of about 95% across six scenarios; the authors state that existing defenses are insufficient.
This is a network side-channel attack paper: the authors analyze the encrypted traffic of LLM streaming output and propose the NetEcho framework to recover full conversations.
- Problem: token-by-token streaming causes packet lengths and timing to leak semantics; the authors state that existing active defenses are adopted by only a few large vendors, that the strength of passive defenses is limited by user experience, and that prior attacks could recover only partial information such as topics.
- Method: the attacker passively eavesdrops and probes the target application as an ordinary user to build a conversation-trace database; a two-tower retrieval model locates semantic neighborhoods by trace similarity, a local LLM generates responses under trace-length constraints, and an inference LLM iteratively rewrites prompts along a "semantic gradient", with at most 3 rounds of refinement.
- Scenario analysis: six of the seven deployment scenarios have exploitable traces; topic recovery Top-1/Top-3 accuracy reaches 98.2/99.5% on DeepSeek-Chatbot medical data (Table IV).
- Conversation recovery: the six experiments average about 95% attack success, with several groups such as Exp.1/4 reaching 100%; the authors report recovery of about 65% of responses / 80% of prompts for medical data and about 80%/55% for legal data, with a total budget of $55.
- Robustness: 97.9%/87.6% of victim conversations are still recovered under 80k imbalanced data; replacing the local model with a different tokenizer costs <10% accuracy; ≤20% dummy packets reduce accuracy by only 2% on average.
- Authors' conclusion: current defense mechanisms cannot eliminate the leakage, and network side-channel risk is underestimated; the authors call for incorporating application-layer defenses such as padding into streaming protocol design, and plan to propose an integrated defense toolkit.