How Cloudflare's GLM-5.3 KV Cache Bug Leaked Other Customers' Data: Prefill/Decode Disaggregation and SGLang, Explained


The client got HTTP 200. That detail bothers me most.

Cloudflare’s post-mortem, published yesterday, describes a bug in its Workers AI deployment of the GLM-5.3 model. Between August 27 and September 9, “155 responses were affected, all to prompts longer than 681,280 tokens.” Those responses contained data from other customers’ requests. Every one of them came back looking like a normal, successful API call.

This is the clearest public example I’ve seen of how shared inference infrastructure can leak between tenants, so it’s worth walking through.

Background: prefill and decode on different GPUs

Generating a response from a large language model has two phases.

Prefill reads the whole prompt at once and builds the KV cache, the stored key and value vectors for every token that the model will attend over while generating. This is compute-heavy.

Decode generates output one token at a time, attending over that cache. This is memory-bound.

Because the two phases stress hardware differently, big deployments split them. From Cloudflare: “a pool of prefill GPUs processes the prompt… then hands that cache over remote direct memory access (RDMA), via Mooncake, to a pool of decode GPUs.” The serving engine is SGLang.

KV cache lives in fixed-size pages. Pages get reused across requests, which is normal and fine, as long as nobody reads a page that wasn’t written for them.

Bug one: a config mismatch

“We deployed GLM 5.3 with a 1,048,576-token context window, but the KV cache pool on our prefill GPUs only had room for 681,280 tokens.”

So the API accepted prompts up to about 1M tokens, but prefill could only hold about 65% of that. Any prompt between 681,280 and 1,048,576 tokens was too big for the prefill pool.

On its own, that should produce an error. The second bug made it produce a leak.

Bug two: reject without aborting

When a request was too long, SGLang’s disaggregated path marked it rejected and “replaced [it] with a one-token placeholder, but instead of aborting the request and returning a client error, prefill generated the KV cache for the placeholder.”

Then the handoff to decode happened as if nothing was wrong. Decode reserved the pages it expected for the full prompt (Cloudflare’s example: eight pages), but only the first page had been written, for the one-token placeholder. The other seven pages still held whatever was there before: KV cache from someone else’s earlier request.

Decode attended over those stale pages and generated a response conditioned on another customer’s data. Then returned HTTP 200.

Single-node mode, where prefill and decode run together, wasn’t affected. This only happened in the disaggregated setup.

How it was found and fixed

Security researcher Gadi Evron of Knostic reported it through HackerOne on September 8. On September 9, Cloudflare declared an incident at 13:22 UTC, reproduced the leak with two accounts within 25 minutes, made the model private at 14:00, found the root cause at 14:35, and restored the model at 19:40 after a full rebuild.

The fixes:

  • Prefill pool resized to about 2.04 million tokens, “roughly twice the 1,048,576-token context length.”
  • A rejected request “is retired at the disaggregation admission queue, with its original error, before any bootstrap, allocation, or KV transfer happens.”
  • Upstream SGLang fixes. Cloudflare recommends SGLang v0.5.22 or later.
  • Optional KV checksums (--disaggregation-enable-kv-checksum) and work on per-page ownership tags.

One uncomfortable detail: the same SGLang behavior had been reported upstream as issue #30233 on July 6, weeks before GLM-5.3 went live on Workers AI.

Cloudflare says no other Workers AI model was affected and it found no evidence of deliberate exploitation.

If you run your own inference

Three checks this suggests:

  1. Does your advertised context length fit your KV cache pool? If not, what happens at the boundary? Test it with a prompt one token over.
  2. Does an over-limit request return a 4xx? Not a 200 with a short response. Watch for this in any disaggregated setup.
  3. Can a request ever read a page it didn’t write? Ownership tags or checksums on KV pages turn a silent leak into a detectable error.

The general lesson: shared caches are a multi-tenant boundary, and they need to be treated like one. An error path that “fails open” into reading stale memory is exactly the kind of bug that never shows up in normal tests, because normal tests never send a 900K-token prompt.

Sources