LLM serving cache poisoning: your vLLM and SGLang cache can be poisoned, NDSS 2026 breaks KV hash collision and semantic cache misses

A finding that should make your back stiffen: the LLM cache you use to cut cost may be getting poisoned. The 2026 NDSS paper "Cache Me, Catch You" by XingTuLab audited the caching mechanisms of vLLM, SGLang and GPTCache, and found that KV prefix caching, image caching and semantic caching all rely on hash keys that can be collided -- letting an attacker make their crafted request hit someone else cache (source: NDSS 2026; GitHub XingTuLab/Cache_Me_Catch_You).

Why serving caches exist, and why they bite

Three caches are performance lifelines: KV prefix caching reuses KV already in VRAM for requests sharing a prefix; image caching skips repeated preprocessing for multimodal models; semantic caching reuses a previous answer for semantically similar questions. The weak point is the cache key -- at heart it is a hash. Once an attacker can forge a hash collision, a request that should be handled independently silently hits a carefully crafted cache entry. The fallout: wrong output, information leakage, even content-filter bypass.

Three vulnerability classes, one by one

1. KV cache prefix hash collision. SGLang and vLLM key prefixes with Python tuple hash. The paper uses a Meet-in-the-Middle (bidirectional birthday) attack -- hash_coll.py plus an OpenMP-accelerated omp_collision_cd.cpp in the repo -- to search for collisions. After hitting someone prefix cache, your request reuses KV computed from the victim context: cross-user hit, leakage and filter bypass in one move.

2. Image cache hash collision. vLLM hashes images with tobytes() then SHA-256; SGLang uses SHA-256; there is also a size-based collision. The paper shows three vectors: P-image (abusing PNG palette mode to build visually different images with identical hashes), SHA-256 collision search, and size-image (same raw pixels but different displayed content). The multimodal model then treats a reskinned image as the same one.

3. Semantic cache inconsistency. GPTCache-style caches judge "same question" by embedding similarity. The paper shows requests with high similarity scores can mean something completely opposite or even contradictory -- so a question that should be answered fresh gets a wrong or harmful reused answer.

The CVE list that already exists

VulnerabilityFrameworkID
KV cache collisionvLLMGHSA-rm76-4mrf-v9r8 / CVE-2025-25183, CVE-2025-1953
Image hash collision (tobytes)vLLMGHSA-c65p-x677-fgj6 / CVE-2025-46722
PNG tRNS transparency bypassvLLMGHSA-8jr5-v98p-w75m
Semantic cache inconsistencyGPTCachefix PR #669

None of this is theoretical. The authors disclosed responsibly to each framework maintainer; vLLM and SGLang shipped fixes in later versions, but plenty of self-hosted instances are still on old builds.

Hands-on: three steps to audit and harden

Step one, know which version you actually run. This snippet reads installed framework versions and flags the ones below known cache-CVE lines:

import importlib.metadata as md

# packages your serving stack actually imports
PKGS = {"vllm": "vllm", "sglang": "sglang", "gptcache": "gptcache"}

# highest version known to carry a cache-collision CVE (illustrative; verify on NVD)
VULN = {
    "vllm": "0.6.3",      # CVE-2025-25183 / CVE-2025-46722 affect <= this line
    "gptcache": "0.1.44", # semantic-cache inconsistency, fixed in PR #669
}

for label, pkg in PKGS.items():
    try:
        ver = md.version(pkg)
    except md.PackageNotFoundError:
        print(label + ": not installed, skip")
        continue
    ceil = VULN.get(label)
    if ceil and ver <= ceil:
        flag = "below safe line, cache CVE present"
    else:
        flag = "above known safe line"
    print(label + " " + ver + ": " + flag)

Step two, verify prefix caching does not leak across requests. Against any OpenAI-compatible endpoint, send a long prefix A, then a completely different prefix B, and watch whether B returns suspiciously fast or borrows content that belonged to A. If anything looks off, turn prefix caching off:

# vLLM: do not enable prefix caching (matters for untrusted / multi-tenant input)
vllm serve meta-llama/Llama-3.1-8B-Instruct     --enable-prefix-caching False

# or set it explicitly in EngineArgs
# from vllm import EngineArgs
# EngineArgs(enable_prefix_caching=False)

Step three, put a consistency gate in front of semantic caching. Do not trust embedding similarity alone; add a light check: before reusing a key, compare structured fields (intent label, entity set) and treat mismatch as a miss:

def semantic_get(cache, query_vec, query_meta, sim_threshold=0.92):
    hit = cache.nearest(query_vec, sim_threshold)
    if not hit:
        return None
    # similar is not safe: mismatch on structured fields means miss
    if hit.meta["intent"] != query_meta["intent"]:
        return None
    return hit.value

Verdict: caching is a tug-of-war between speed and safety

Caching can cut your inference cost substantially, but once its hash key is collidable it becomes a cross-user attack surface. Self-hosting open weights gives you more control, and also means you own these holes. The cheapest actions are three: upgrade frameworks to CVE-fixed versions, disable prefix caching for untrusted input, and add structured consistency checks to semantic caches. Do not wait to be poisoned before remembering the hash key was never a security boundary.

Further reading

フィードバック

このサイトはフロントエンドのみでバックエンドやアカウントはなく、フィードバックはGitHub Issues・ディスカッション・メールで受け付けています。

issueやメールに貼り付けていただくと問題特定が早まります。入力内容は含まれません

その他:既存の報告を見る · メールでのフィードバック(GitHubアカウント不要):278975598@qq.com