Large Language Models (LLMs) are increasingly deployed as shared multi-tenant services, relying on advanced optimizations like KV cache and prefix sharing to improve throughput and reduce latency. However, these optimizations introduce a critical vulnerability: attackers can exploit time-to-first-token (TTFT) variations between KV cache hits and misses to infer sensitive prompt tokens via prefix-matching side-channel attacks. Existing defenses indiscriminately restrict cross-tenant cache sharing, which incurs prohibitive performance overhead and negates the fundamental efficiency benefits of the KV cache. We propose Mirage, a topology-aware emission obfuscation framework that provably bounds timing leakage without sacrificing the performance gains of cache sharing. Instead of stalling the GPU or forcing redundant recomputations, Mirage delays token emission at the gateway so the attacker observes a natural cache miss distribution, while the GPU seamlessly continues serving other requests at full speed. Mirage uses a Privacy Odometer that persistently tracks the topological novelty of prefix fan-out expansions to distinguish aggressive probing from benign traffic. Once a prefix exceeds a safety threshold, Mirage engages a two-phase policy that uses a dynamic estimator to pad the TTFT to a calibrated cache-miss baseline. On a 500-sample public corpus across three models, Mirage suppresses the timing side-channel to near the random-guessing floor, while maintaining a significantly lower TTFT than defense baselines. We further show that Mirage withstands a strong adaptive adversary and the same principle carries over to semantic caching layers.
Figures & tables
Fig. 1: An attacker appends candidate guesses ci to a sensitive prefix P and times the reply: a cache hit reveals the match. Mirage ’s control plane (teal) meters this fan-out while the unchanged engine (blue) serves the shared cache at full speed; the gateway (coral) passes benign streams through and shifts every token of a locked-down stream by one offset Δpad (rose), so timing no longer reveals the hit.
Model
Defense
EarlyBird ↓
InputSnatch ↓
OptiLeak ↓
ASR@100
ASR@1k
ASR@10k
ASR@100–10k
ASR@100
ASR@1k
ASR@10k
DeepSeek-14B
No Defense
21.6
92.4
92.4
59.4
25.5
41.2
68.8
Cache Partition
0.0
0.5
0.5
0.0
0.0
0.0
0.0
CacheSalt
0.0
0.0
0.0
0.0
0.0
0.0
0.0
SafeKV
0.0
0.5
0.5
0.0
0.0
0.0
0.0
Mirage
0.0
0.2
0.2
0.4
0.0
0.0
0.0
TABLE I: Attack Success Rate ( ASR@N , %) across model scales and defenses.
Configuration
Benign first-visit
Under attack
Attack
TTFT (ms)
TTFT (ms)
ASR
No Defense
149
151
leaks
Mirage ( G=1 )
150
418
≈0
Naive pad-all ( G=0 )
417
416
≈0
TABLE II: Median TTFT (ms) of a sensitive access (Llama-3-8B): Mirage pads only under attack; pad-all pads every sensitive request.
Fig. 2: Median TTFT (log scale) vs. offered load on public traffic. Mirage (pink) closely tracks No Defense (grey dashed, largely occluded); isolation baselines sit above. Curves converge only in the saturated tail, where queueing dominates.
Fig. 3: Goodput vs. offered load (Llama-3-8B). Mirage tracks No Defense along the ideal line; per-tenant isolation saturates ∼1.6× earlier.
No Defense
Mirage -Semantic
Attack Objective
Backend
ASR ↓
AUC → .5
Δt↓
ASR ↓
AUC → .5
Δt↓
Membership
Qwen1.5-1.8B
99.2
1.00
71.6
54.1
0.55
-0.6
Llama-3-8B
99.2
1.00
246.8
46.8
0.48
-0.9
DeepSeek-14B
99.2
1.00
448.8
53.7
0.47
4.3
Closed-world
Qwen1.5-1.8B
96.0
1.00
70.0
11.0
0.51
0.0
Llama-3-8B
99.0
1.00
243.2
13.0
0.54
0.2
TABLE III: Semantic-cache generalization. ASR baselines 50/10/2.5% ; AUC 0.5 = closed; Δt = mean miss − hit gap (ms), ≈0 once equalized (small negatives are noise).
Model
Defense
TTFT
ITL-only
Whole trace
Per-trace
Llama-3-8B
No Defense
0.98
0.90
0.99
0.99
Mirage
0.58
0.53
0.56
0.58
DeepSeek-14B
No Defense
0.97
0.81
0.98
0.96
Mirage
0.60
0.63
0.60
0.56
TABLE IV: Content-controlled whole-trace distinguisher (effective AUC, 0.5 = closed; fixed probe, pure timing). Mirage holds TTFT, ITL, and whole-trace features at chance (A2).
Emitter
Eff. AUC → .5
Mean pad (ms) ↓
Clamp ( Mirage default)
0.53 ± .01
35
Full CDF ( q0=0 )
0.67 ± .04
10
Tail-conditioned ( q0=0.7 )
0.55 ± .06
12
Parametric log-normal ( q0=0.7 )
0.58 ± .10
23
TABLE V: Emitter ablation (effective AUC, n=3 runs). Only the clamp closes the channel in every run; distributional emitters cut overhead but leave a residual.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Attack
No Defense
Mirage (Ours)
DeepSeek-14B
EarlyBird
92.4 [90.0, 94.6]
0.2 [0.0, 0.6]
InputSnatch
59.4 [55.0, 63.8]
0.4 [0.0, 1.0]
OptiLeak
68.8 [66.0, 71.6]
0.0 [0.0, 0.1]
Llama-3-8B
EarlyBird
33.4 [29.4, 37.6]
0.0 [0.0, 0.6]
InputSnatch
34.2 [30.0, 38.4]
0.4 [0.0, 1.0]
OptiLeak
81.8 [79.1, 84.3]
0.0 [0.0, 0.1]
Appendix
TABLE VI: Headline ASR with 95% percentile bootstrap CIs (%): EarlyBird and OptiLeak at ASR@10k, InputSnatch end-to-end. Mirage measured-zero cells show a rule-of-three upper bound.
Metering policy
Benign pattern
Padded
TTFT (ms)
Global budget
distinct continuations
93%
87
Global budget
exact repeats ( ρ=0 )
0%
25
Trust-scoped †
distinct continuations
0%
25
Appendix
TABLE VII: Benign-sharing stress test (Llama-3-8B, G=1 , pessimal global budget): a pad is a small shift on a still-cached hit; scoped metering removes it. † Simulation.
Defense
Public
Sensitive-shared
@8 req/s
@8 req/s
@16 req/s
No Defense
87
86
542
Mirage
89
91
611
Cache Partition
88
88
1858
SafeKV (selective)
89
88
1777
Appendix
TABLE VIII: TTFT (ms), 64 tenants sharing one sensitive prefix (Llama-3-8B, MRR=16 ): near capacity, recomputation inflates isolation ∼3× ; Mirage tracks No Defense.
Grace budget
G=0
G=1
G=2
G=3
(pad-all)
(default)
Benign hit latency (ms) ↓
476
44
42
46
Spread-candidate ASR (%)
11.6
12.0
12.1
11.1
Appendix
TABLE IX: Grace-budget trade-off (Qwen1.5-1.8B, 5 seeds): benign hit latency saturates at G=1 ; spread-candidate ASR stays at the 12.5% baseline for every G .
Setting
ρ
Eff. AUC → .5
Realistic (self-pollution)
0
0.501
Idealized oracle
0
0.975
Idealized oracle, charged
1
0.516
Appendix
TABLE X: Repeat-weight ablation (exact-repeat evasion, effective AUC). Self-pollution already neutralizes it; the idealized oracle is closed by charging repeats ( ρ=1 ).
Config
Eff. AUC → .5
Mean pad (ms) ↓
q=0.97,η=0.20 (default)
0.58
28
q=0.90,η=0.20
0.52
27
q=0.97,η=0.10
0.54
24
q=0.97,η=0.30
0.51
33
Appendix
TABLE XI: Clamp quantile q and margin η sweep (Qwen1.5-1.8B): the residual stays near chance while the pad moves modestly, with no knife-edge.
Configuration
R
Eff. AUC → .5
Top-1 ASR ↓
Multivariate Distinguisher
No Defense
10
0.807
–
No Defense
20
0.962
–
Mirage (clamp)
20
0.53 ± .01
–
Spread-Candidate Scan ( R=5 , baseline ≈0.51% )
Oracle ( θ=1.0,ρ=0 )
5
–
76.5%
Appendix
TABLE XII: White-box adaptive attacks (Qwen1.5-1.8B). The distinguisher stays at chance against the clamp; spread-candidate rows are a stacked-oracle bound, closed by ρ=1 or G=0 .
Large Language Models (LLMs) rely on optimizations like Automatic Prefix Caching (APC) to accelerate inference. APC works by reusing previously computed states for the beginning part of a request (prefix), when another request starts with the same text. While APC improves throughput, it introduces timing side channels: cache hits are faster than misses, creating observable latency differences. In multi-tenant systems, attackers can exploit these differences to infer sensitive information, e.g., by incrementally reconstructing another user's request by observing hit/miss patterns. Current defenses take a sledgehammer approach: they disable APC and cache sharing, isolating users, and sacrificing efficiency for regular users. This paper presents CacheSolidarity, a system that secures multi-tenant LLM serving systems against APC side channels without sacrificing performance and efficiency. CacheSolidarity monitors cache reuse across users, flags suspicious sharing, and selectively isolates prefixes, restricting their reuse only when necessary. Evaluation shows that CacheSolidarity enables up to 70% higher cache reuse and 30% lower inference latency compared to existing user-isolation defenses. CacheSolidarity's lightweight design demonstrates how LLM serving can be secured without sacrificing performance or incurring unbearable overheads.
Panagiotis Georgios Pennas, Konstantinos Papaioannou, Marco Guarnieri +1
IMDEA Software Institute Universidad Politécnica de Madrid · IMDEA Software Institute
The key-value (KV) cache is the primary throughput optimization in modern large language model (LLM) inference, enabling prefix reuse across requests. In multi-tenant deployments this cache is shared across tenants, creating a timing side channel: an adversarial tenant can reconstruct another tenant's private prompt by probing cache-hit latency. Three published attacks exploit it -- PROMPTPEEK, EarlyBird and InputSnatch -- reaching up to 100% attack success rate against unprotected vLLM and SGLang, with rates varying by cache architecture and prompt structure. We present KVGov, a governance layer addressing all three attack families' prefix-cache paths under one mechanism. A per-principal salt sigma_p = HMAC_K(secret, principal_id) seeds the block-hash chain, making cache keys cryptographically disjoint across principals. An ablation (N=1000 trials, seed 2026, deterministic judges) isolates this salt as the necessary and sufficient component. KVGov adds ORIGAMI, a Stackelberg water-filling audit scheduler that reduces adversary expected utility by 12.6% at realistic tenant heterogeneity (Gini 0.63), and an evolutionary stability analysis giving a 31.6% adversary-prevalence tipping point below which global caching remains stable. On real hardware (Qwen2.5-7B-Instruct, vLLM 0.26.0, NVIDIA A100) we measure a gate-verified cold/cached TTFT ratio of 0.22, confirming the channel is exploitable at production scale; the defense itself is evaluated in simulation calibrated to those measurements. We replicate the channel on an independent stack (llama.cpp on Apple Metal, ratio 0.093). Finally, isolation and cache efficiency need not conflict: identifying information resides only where prompts diverge, so injecting the salt at that boundary rather than the chain root retains an estimated 93% of the prefix-cache benefit with no cross-principal signal.
Shared key--value (KV) cache reuse improves large language model (LLM) serving, but it can also create a timing side channel that reveals whether a prefix is already cached. Previous work shows that such attacks are possible, but their reliability under realistic multi-tenant contention is less understood. We study this problem through seven experiments on live shared LLM-serving systems. On a vLLM server running DeepSeek-R1-Distill-Llama-8B on NVIDIA GB10, mean Cohen's d drops from 0.7789 with no synthetic workers to 0.2109 with two workers (t=8.412), while higher worker counts cause no statistically detectable further loss. A 120-run sparse-overlap experiment places the best breakpoint at the boundary of the measured range (tau=0, 95% CI [0.000,0.113]), supporting an ambient-versus-loaded regime change rather than an internal physical threshold. AUROC falls from 0.650 at ambient to 0.531 near 61% overlap and partially recovers to 0.574 at saturation. Concurrency-depth variance is the strongest measured correlate of effect size (r=-0.416) and hit consistency (r=-0.637). An interleaved control preserves the same non-monotonic ordering. The main collapse is also reproduced on a real two-node, two-GPU tensor-parallel vLLM setup, where mean d falls from 3.418 to 0.511 (p<0.01). Two SGLang pilots are statistically inconclusive. Overall, KV-cache timing reliability depends strongly on the load regime and serving stack, and measurements on quiet systems can overestimate operational attack reliability.