Articles · 2026 · Reading: 13 min, plus 2 in closed details.
Article · postmortem · The Cloudflare Blog

Cross-request KV cache exposure in the GLM-5.3 Workers AI model, and our remediation with SGLang

Kevin Flansburg, Michelle Chen (Cloudflare) · published 26 October 2026

In one line: From 27 August to 9 September 2026, Workers AI's GLM-5.3 endpoint advertised a 1,048,576-token window on a 681,280-token prefill KV pool; prompts over the pool took SGLang's rejection path, which in disaggregated mode still handed decode one token of cache, and decode answered from reserved pages still holding earlier requests' data. Cloudflare counts 155 affected responses; the fix enlarged the pool and retires rejected requests before the handoff, as SGLang's main branch already did two days before the report.

155 responses affected
27 August to 9 September 2026, all to prompts over 681,280 tokens
Cloudflare's count; no sign of deliberate exploitation · in the article: the opening
681,280 tokens of prefill KV pool
behind a 1,048,576-token context window: 65% of what the window promised
sized from memory the weights leave free, not from the window · in the article: What happened
about 2.04M tokens after the fix
the prefill pool after the fix, about twice the window
plus an engine patch that refuses before the KV handoff · in the article: Immediate remediation

How far to trust it: Believe the mechanism and the fix: SGLang's own source, pull requests and companion post confirm every step. Read 155 as a count of affected replies, method unstated, saying nothing about whose data surfaced; and note that the mismatch was known before launch and the bug public since 6 July. The evidence, judged.

The idea in one sentence: a serving engine reuses KV cache pages without clearing them, so isolation between users rests on its bookkeeping alone; Cloudflare accepted prompts its prefill pool could not hold, SGLang refused them internally yet still completed the handoff to decode with one token of real cache, and decode answered from reserved pages still holding earlier users' keys and values.

You need: paged KV memory, a pool of fixed-size pages handed out and reclaimed by the engine (Batching, KV cache and scheduling in depth, sections 1 and 2); prefill and decode on separate GPUs with the KV cache copied between them (Distributed and disaggregated serving, section 6); SGLang's pool flags (SGLang, section 7).

New terms: KV pool (GPU memory SGLang reserves for KV pages at start-up, sized from what the weights leave free); rejection path (SGLang refusing a request inside the scheduler: record the error, swap the prompt for a one-token placeholder, let it drain through the batch); admission queue (the door each disaggregated worker passes a request through); bootstrap (the router announcing a request's length to decode, which reserves pages); deferred release (keeping an aborted request's pages reserved until no remote write can still land in them).

Predict before you drag: a 700,000-token prompt, pool as launched, engine before the fix. Of the keys and values decode attends over while it writes the reply, how much did this request write itself?

The window promised 1,048,576 tokens; the prefill pool held 681,280, and every prompt in between took the rejection path
500,000
SGLang v0.5.19 refuses a prompt of at least min(window − 1, pool − 1) − 5 tokens, 681,274 here (tp_worker.py L543-556, utils.py L219). Fixed pool: 2,040,000 tokens (the post's "about 2.04 million"). Page size 64 is illustrative (issue #30233's GLM-5.2 deployment; Cloudflare gives none). Computed exactly, checked against src/recompute.py.

1. Thirteen days, 155 responses, one endpoint

What happened

For thirteen days, long prompts to one Workers AI model could be answered from other customers' data. GLM-5.3 (@cf/zai-org/glm-5.3) launched on 27 August 2026; on 8 September Gadi Evron of Knostic reported through HackerOne that very long prompts sometimes returned text from other users' sessions. Cloudflare reproduced it the next morning, took the model offline within 40 minutes of declaring an incident, and restored it at 19:40 UTC the same day. In total, 155 responses were affected, all to prompts over 681,280 tokens; no other model was.

Cloudflare reads the traffic as ordinary use, not an attack: outside its own and the researcher's tests, the requests were consistent in timing and volume with ordinary long-context use. The timeline on the right adds what the post mentions only in passing: the engine bug was reported publicly seven weeks before launch, and the change that stops it reached SGLang's main branch two days before the report.

The bug was public before the launch and fixed upstream before the report
CloudflareSGLang projectresearcher
From the post's timeline (UTC), SGLang's post, GitHub and SGLang's release dates; spaced by event, not to scale. Shaded: the 13 days of exposure. Every event, in full, is in the closed list below.
The timeline as a list

6 July: issue #30233 reports the bug (GLM-5.2, 1M window). 3 August: Cloudflare's post on page-tag integrity checks. Mid-August: tags tested on GLM 5.2, then disabled. 27 August: GLM-5.3 launches with pool 681,280 below window 1,048,576. 5 September: #30233 closed for inactivity; v0.5.19 released without the fix. 6 September: #36988 merged. 8 September 23:11: report. 9 September: incident 13:22, model private 14:00, restored 19:40. 16 September: #38935 and #39500 merged. 18 September: v0.5.20 with #36988. 2 October: v0.5.21, deferred release on by default. 19 October: v0.5.22. 26 October: coordinated disclosure.

2. Issue one: a context window larger than the pool behind it

Issue one: misconfiguration

The pool and the window are two numbers nothing ties together. SGLang sizes the KV pool from whatever GPU memory remains after the weights load; the advertised context length is a separate setting, and Nothing forces the two to agree. On GLM-5.3's prefill nodes the pool came to 681,280 tokens against a 1,048,576-token window: 65% of it. Why a million-token cache is that large is Long context's calculator.

Cloudflare knew, and expected an error. The pool size is in SGLang's start-up log and metrics, and the gap was known before launch; We expected the engine to return an error, and long-context benchmarks returned HTTP 200. The tests only validated HTTP response codes and engine performance, never the output; by section 3's mechanism those successful tests were most likely answered from other requests' cache too.

The engine did refuse the prompts, inside. Drag the prompt past 681,274 tokens in the figure at the top. The refusal was real; what went wrong is where the refused request went next.

A rejected request passed both admission queues and decoded from pages it never wrote
One request whose prompt fills 8 KV pages, as in the post's own diagram. Pages start with what earlier requests A, B and C left in them (hatched): the pool is never cleared. Green: KV written by this request. Redrawn from the post's figure (which carries no open licence), with a third mode from SGLang's fix #38935.

3. Issue two: a rejected request looked live to both admission queues

Issue two: SGLang bug

Freed KV pages keep their contents. A request gets pages from a shared pool when admitted and returns them when done, and Pages are not currently zeroed between requests: the next owner overwrites them. That is standard and needed for speed, so the engine's record of who owns which page is the only isolation between users (the block pool: Batching, KV cache and scheduling in depth, section 1).

The rejection path was built for one machine. Req.set_finish_with_abort stores the error in to_finish and swapped the prompt for a one-token placeholder, so the request drains through the normal batch. On a single-node deployment this worked. In disaggregated mode both workers' admission queues ask req.finished(), which reads a different field, finished_reason, so a refused request looked live (schedule_batch.py at v0.5.19, L1359-1361 and L1927-1946):

  1. Bootstrap. The router tells decode the prompt is 8 pages long; decode reserves 8 pages, still holding earlier requests' data.
  2. Prefill admission. The rejection sits in to_finish, finished() returns False, and the request is admitted.
  3. Forward pass on one token. The prompt is already the placeholder, so prefill computes KV for a single token.
  4. Transfer. One page crosses to decode with the "transfer complete" signal.
  5. Decode admission. The same finished() check, the same blind spot: the handoff is accepted.
  6. Attention over all 8 pages. Only page P0 had been written by this request; P1 to P7 hold other users' prompts and partial answers.
  7. Response. HTTP 200 instead of 400, a coherent reply, prompt_tokens matching the long prompt, faster than an 8-page prefill could be, and other users' content in it.

In the real incident the reservation was thousands of pages. With 64-token pages a 700,000-token prompt reserves 10,938 pages on decode, and one placeholder token was all it wrote, so the reply was conditioned on 699,999 tokens of other requests' leftovers. Every request over the threshold behaved this way: a deterministic path, not a race.

The same bug was already on file. It had been reported to SGLang by another user as issue #30233 on 6 July, on a GLM-5.2 deployment with the same 1,048,576-token window and a 284,928-token pool, root cause traced and a patch proposed; it was closed for inactivity on 5 September. GLM 5.3 was the only model affected because every other deployment had pools larger than its window.

4. The fix: a pool that holds the window, and a rejection that stops before the handoff

Immediate remediation

Either change alone closes this path; Cloudflare made both. The configuration took GLM-5.3 to its GLM-5.2 settings, freeing memory for a prefill pool of about 2.04 million tokens, so a prompt that fits the window fits the pool. The engine patch exists because Relying on pool size alone is fragile: quantization, parallelism, CUDA graphs or a new model version all move the pool, so a request with a pending rejection is now retired at the disaggregation admission queue before any transfer. Both were checked against the researcher's script and our own canary-marker tests (a known marker in the prompt that the reply must reflect).

ChangeWhat it doesStatus (27 November)
Cloudflare config, 9 SepPrefill pool about 2.04M tokensIn production
Cloudflare patch, 9 SepRetires a rejected request at admissionIn production; upstream as #38704
#36988Retires an aborted request before its KV reaches decode (written for a failing vision encoder)Merged 6 Sep; v0.5.20
#38935Retires it at both admission doors: "a waste-and-latency fix, not a correctness fix"Merged 16 Sep; v0.5.21
#38704Cloudflare's admission fix plus a transferred-length checkClosed unmerged 10 Oct; length check declined

The post credits the upstream fix accurately but quietly: The fix was already on SGLang main in #36988. #38935's author is plainer: after #36988 the stale-KV symptom does not reproduce on main, so #38935 only saves a wasted handshake and, when both workers refuse, a 300-second decode timeout.

Freed at abort, a slot can be reused while the aborted request's write is still on its way
Ten slots of one decode pool, request A's transfer from prefill aborted half way. Illustrative sizes; the order of events and the rule follow SGLang's companion post ("The Problem: When Is a KVCache Slot Actually Free?" and "Deferred Release"), which reproduced the overlap on two H200s.

5. The wider class: a page freed, reused or read while something still claims it

Ongoing hardening effort

This incident belongs to a family Cloudflare had been fixing for months: a page is freed, reused, or read while something else still has a claim on it. Inside one decode node, generation, host offload, the transfer receiver and abort paths can all hold a page (Cloudflare's fixes #24226, #30899, #30937). Across nodes, prefill writes KV straight into decode's memory by one-sided RDMA, and the writes already sent cannot be recalled:

  1. A transfer in flight. Prefill streams A's KV into slots 3 to 7 on decode: two chunks have landed, one is posted to the network card, two wait in prefill's queue.
  2. Abort, slots freed. A's client disconnects; decode aborts A and returns slots 3 to 7 to the allocator at once.
  3. Reused. The allocator gives those slots to request B, whose own KV is written there.
  4. A late write lands. A's posted chunk arrives in slot 5, now B's; nothing reports an error.
  5. B decodes on A's keys and values. Garbage, or fragments of A's prompt in B's reply.

The incident's bug was the deterministic cousin of this race: a rejected request went through the handoff every time, with the same result. Deferred release became SGLang's default in v0.5.21, at no measurable throughput cost (within ±2% over 21 runs on 2×H100, SGLang's post).

Cloudflare's hardening since the incident

Deferred release extended to every failure type and to prefill's source pages (SGLang's analysis judged that path already safe); bounded Mooncake transfer batches, so one call cannot outlast the release timeout; a load balancer that no longer aborts on a client disconnect, holding prefill until it finishes and decode until the first token; and a check on every disaggregated deployment change covering pool against window, deferred release on both roles, batch bounds and required patches.

6. What any operator should check, and the longer-term fix

What we recommend to other operators

The post's five recommendations for anyone running disaggregated SGLang, the first being the check we did not enforce:

  1. Pool against window on every node, from the engine's start-up log, after any change to weights, quantization, parallelism or memory fraction; lower the context length if the pool is smaller. Do not rely on a proxy to enforce the limit.
  2. v0.5.22 or later, or backport #36988 and #38935.
  3. Deferred KV release on both roles (default since v0.5.21) and bounded Mooncake batches.
  4. Corruption detection (--disaggregation-enable-kv-checksum, --kv-canary), which do not yet cover every model architecture, GLM 5.3 included.
  5. Fewer aborts mid-transfer: let the load balancer carry a request to its first token.

The general lesson: test content, not status. A canary marker in a long prompt that the answer must repeat would have failed; a 200 where a 400 was expected, and a reply faster than its prefill could take, were the signs.

Longer term, the engine should refuse to read a page it does not own. In Cloudflare's prototype Every physical KV page carries a tag that changes on reallocation, checked before decode reads; under 1% overhead, tested on GLM 5.2 in mid-August and disabled it shortly afterwards due to reliability issues, about two weeks before GLM-5.3 launched. SGLang's checksum (#39500) checks only the handoff; tags would check every read. Cloudflare also plans to prove its RDMA transfer protocol safe with formal methods.

How much of this to believe

The mechanism holds up independently of Cloudflare: every step of section 3 is in SGLang's v0.5.19 source, another user reported the same failure in July, #38935's tests cover both doors, and the maintainers' post agrees. The post is candid about the known mismatch and the status-only tests, and unchanged across every archived copy.

What it leaves out or frames generously:

  • The 155 counts receivers, by a method not stated. Since every over-limit request took the path, it is most likely the count of over-limit GLM-5.3 requests in the 13 days; whether the tests are inside it is unclear. Nothing is said about how many customers' prompts surfaced in those replies, what data, or whether they were told; the status notice at the time spoke of "increased errors".
  • "Two overlapping issues" spreads the cause evenly; the timeline does not. The engine bug was public from 6 July and fixed on SGLang's main on 6 September. What only Cloudflare controlled was launching with a pool it knew was too small and testing status codes instead of output.
  • The integrity check that would have caught it was off. The August post presented page tags as built; this one says they were disabled before GLM-5.3 launched.
  • Which release fixed it is stated two ways: "Issue two" opens with v0.5.21; the same section and the table give v0.5.20 for #36988, as GitHub does.

Verdict: believe the mechanism, the timeline and the fix, corroborated by code Cloudflare did not write. Treat 155 as a count of affected replies, not a measure of whose data was exposed, and read the post as an honest account of a known risk accepted at launch rather than an unforeseeable engine bug.

What the responses said

Hacker News (read 27 November): 182 points, 79 comments, most of them arguing that the title names the model rather than the endpoint.

Where it moves the knowledge base

  • Batching, KV cache and scheduling in depth: a freed page keeps its contents, so ownership bookkeeping is the only isolation between users.
  • Distributed and disaggregated serving: the handoff's two failure modes (a refusal that still hands off, an abort whose writes outlive the slots), and "pool at least the window on every node" in the section 9 checklist.
  • SGLang: the pool flags set a limit the context length does not; disaggregated deployments need v0.5.22 or the backports.
  • Agent security: below the agent's threat model sits the shared inference server, where a bug can move one tenant's prompt into another's reply with no attacker.
Since the article (checked 27 November 2026): the engine and the fix
Provenance: what was read, fetched and compared

The post was fetched on 27 November 2026 and its main text extracted to src/inputs/article.txt (3,635 words, 16 minutes at 230 words a minute; the 2 November tech-news issue quoted 12). Its metadata gives publication on 26 October 2026 at 22:01 UTC and a modification on 27 October at 08:31. Five Wayback Machine copies (26 October 22:02 UTC, 27 October 04:45 and 09:12, 28 October, 16 November) were extracted the same way: the text is identical in all of them and in the live page, so the modification did not change the prose. Every "in the article" link is a text fragment checked against the extract at build time.

Read on GitHub on 27 November: issue #30233 (body, root cause, proposed patch, closure); pull requests #36988, #38935 and #38704 (descriptions, changed files, comments, merge state); #38935's test file test_admission_abort_not_enqueued.py; draft #46435; SGLang's source at v0.5.19 (schedule_batch.py, tp_worker.py, managers/utils.py) and at v0.5.22 (disaggregation/utils.py is_unadmitted_reject, disaggregation/prefill.py); the release dates of v0.5.11 to v0.5.23. Also read: SGLang's companion post in full; Cloudflare's 3 August post (its integrity-check section); the Cloudflare status incident; the Hacker News item and all its comments through the API (submitted 26 October 22:41 UTC); the LessWrong post via GreaterWrong with its comments.

Figures: the post carries no open licence, so its diagram is redrawn, not embedded, and the hero is computed from the post's numbers and SGLang's source. Not found: the researcher's own report (SGLang's post calls it "available soon"); Cloudflare's own page size, which is why the hero labels 64 illustrative.