Papers › HijackKV: New Threat in Position-Independent KV Cache Reuse

HijackKV: New Threat in Position-Independent KV Cache Reuse

22 Jul 2026arXiv:2607.19957added by Syntology

Yichi Zhang, Zhiqi Wang, Huan Zhang, Yuchen Yang

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

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.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2607.19957")

Code

Syntology Ran 9 of 19 code samples harvested from 1 repository linked to this paper; 10 have no recorded run. Of those that ran: 3 ran · honoured contract; 3 ran · our draft was wrong; 1 ran · fixture could not drive it; 2 ran with no contract checked.

By repository: found in paper text by Syntology: 19 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

YichiCS/KV-Cache-Hijack found in paper text by Syntology report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

19 samples harvested; 9 ran; 3 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
3ran · our draft was wrong
1ran · fixture could not drive it
2ran
10unverified

Licence: 0 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from YichiCS/KV-Cache-Hijack. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

_MutableFullCache YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran MIT (permissive) · 27f464382c95bbe9 · report
_MutableFullLayer YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran MIT (permissive) · 0313706e553c8f30 · report
_build_full_cache YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · 9eafdc121e816f89 · report
_finalize_cache YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · honoured contract MIT (permissive) · 2aa84fa801ebda6f · report
_get_attention_fn YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · ad7c723c05f6ed99 · report
_get_backend YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · 1b82f10788b29034 · report
_get_input_embeds YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · honoured contract MIT (permissive) · 0ef78dc731489619 · report
_next_layer_budget YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · honoured contract fingerprinted MIT (permissive) · 85cf61aa657f9f92 · report
build_kv_cache YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · c16829860cf83849 · report
HijackKV YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · 67b072230d538728 · report
cache_clone YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · 7bcda97c37330638 · report
cache_concat YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · d49bca247e704a2e · report
cache_expand YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · 939411491cb64117 · report
cache_recomputation YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · c32ce06ab3210d82 · report
cache_split YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · 35caf9168740a681 · report
recompute_cacheblend YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · 0424505ffacd2f28 · report
recompute_epic YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · a48916c9da6b4420 · report
recompute_random YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · 504da673b0116fb9 · report
recompute_vanilla YichiCS/KV-Cache-Hijack/src/funcs/attack.py found in paper text by Syntology unverified MIT (permissive) · f97a2afd9fcd1dfa · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2607.19957, was issued in July 2026, after that date, so the archive has no leaderboard rows for it.

Placed on leaderboards by Syntology Syntology

Syntology's extractor considered 2 leaderboards for this paper and placed the paper on none of them: 2 refused by a rule. What is not shown.

Syntology has checked 6,795 of the 9,581 papers on this site that are newer than the archive; results from the others appear after they are checked.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections