HijackKV: New Threat in Position-Independent KV Cache Reuse
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
Key-Value (KV) cache reduces inference latency in large language models (LLMs). Traditional prefix-based reuse has low cache hit rates across inference requests because it requires exact token and position matches. To improve efficiency, recent system optimizations introduce position-independent KV reuse, allowing KV cache to be reused whenever identical text chunks appear, regardless of their position in the sequence. We show this design introduces a new threat, KV Cache Hijacking. Since KV caches are retrieved by token match but encode the context in which they were originally computed, the KV tied to a benign-looking token chunk may encode an attacker-controlled prefix. When later reused in a victim query, this contaminated KV silently hijacks the model's behavior, even if no attacker-controlled text appears in the input. We introduce HIJACKKV, the first attack framework that systematically exploits this vulnerability, demonstrating its severity and practicality. HIJACKKV optimizes an attacker-controlled prefix, so that the KV computed for a subsequent common benign text encodes the attacker's goal, while the text remains unchanged for future cache hits. HIJACKKV achieves an average 94% success rate in a single attempt, remains effective under realistic constraints including low hit rates (10%) and frequent recomputation (50%), persists over multi-turn interactions, and transfers across models in black-box settings. We further provide design insights for building secure KV reuse systems.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 54 of its 61 references that are in the map. First posted on arXiv 22 Jul 2026.
Builds on
54 of 61 references.
Closest ancestors · 11
Same direction, newest first
- 2025MEPIC: Memory Efficient Position Independent Caching for LLM Serving18 Dec
- 2025Whose Narrative is it Anyway? A KV Cache Manipulation Attack16 Nov
- 2025Shadow in the Cache: Unveiling and Mitigating Privacy Risks of KV-cache in LLM Inference13 Aug
- 2025KVShare: An LLM Service System with Efficient and Effective Multi-Tenant KV Cache Reuse17 Mar
- 2025KVLink: Accelerating Large Language Models via Efficient KV Cache Reuse21 Feb
- 2024PyramidKV: Dynamic KV Cache Compression based on Pyramidal Information Funneling4 Jun
- 2024CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion26 May
- 2024SnapKV: LLM Knows What You are Looking for Before Generation22 Apr
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttention12 Sep
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun
- 2023Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression at Test Time26 May
Other references · 43
- 2017Attention Is All You Needcited by 59,932
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2025Qwen3 Technical Reportcited by 8,195
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,500
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
31 more
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2022Large Language Models Encode Clinical Knowledgecited by 1,807
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
- 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,538
- 2024From Local to Global: A Graph RAG Approach to Query-Focused Summarizationcited by 1,411
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
- 2020What Disease does this Patient Have? A Large-scale Open Domain Question Answering Dataset from Medical Examscited by 1,324
- 2019PubMedQA: A Dataset for Biomedical Research Question Answeringcited by 1,271
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,107
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
- 2023Capabilities of GPT-4 on Medical Challenge Problemscited by 630
- 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 604
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 571
- 2022Efficiently Scaling Transformer Inferencecited by 529
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
- 2023MMA-Diffusion: MultiModal Attack on Diffusion Modelscited by 184
- 2023SneakyPrompt: Jailbreaking Text-to-image Generative Modelscited by 175
- 2024Optimization-based Prompt Injection Attack to LLM-as-a-Judgecited by 123
- 2024PLeak: Prompt Leaking Attacks against Large Language Model Applicationscited by 113
- 2024Neural Exec: Learning (and Learning from) Execution Triggers for Prompt Injection Attackscited by 78
- 2025WebInject: Prompt Injection Attack to Web Agentscited by 48
- 2024EPIC: Efficient Position-Independent Caching for Serving Large Language Modelscited by 45
- 2025Language Models are Injective and Hence Invertiblecited by 31
- 2024The Early Bird Catches the Leak: Unveiling Timing Side Channels in LLM Serving Systemscited by 29
- 2024RobustKV: Defending Large Language Models against Jailbreak Attacks via KV Evictioncited by 21
- 2025Auditing Prompt Caching in Language Model APIscited by 19
- 2024Enhancing Prompt Injection Attacks to LLMs via Poisoning Alignmentcited by 18
- 2025Fun-tuning: Characterizing the Vulnerability of Proprietary LLMs to Optimization-based Prompt Injection Attacks via the Fine-Tuning Interfacecited by 15
- 2025Can Transformer Memory Be Corrupted? Investigating Cache-Side Vulnerabilities in Large Language Modelscited by 3
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Visual Memory Attacks Can Persist Through The KV Cachecited by 0
- 2026Visual Memory Attacks Can Persist Through The KV Cache6 Oct 2026
Similar, not cited
Close in wording, no citation either way
- 2026Governing the KV Cache: Preventing Timing Side-Channel Leakage in Multi-Tenant LLM Inference
- 2026AnchorKV: Safety-Aware KV Cache Compression via Soft Penalty with a Refusal Anchor
- 2026KV Packet: Recomputation-Free Context-Independent KV Caching for LLMs
- 2026KVBoost: Chunk-Level Key-Value Cache Reuse with Deviation-Guided Recomputation for Efficient Large Language Model Inference
- 2025KVzip: Query-Agnostic KV Cache Compression with Context Reconstruction
- 2026Agent-Assisted Side-Channel Attacks on Non-Prefix KV Cache in RAG
- 2026KVShareArena: KV-Cache Reuse Across Contexts and Model Checkpoints
- 2025Selective KV-Cache Sharing to Mitigate Timing Side-Channels in LLM Inference