Home › Intelligence › Brief
BREACH BRIEF🟡 Medium Breach

Cross‑Tenant KV Cache Leak Exposes Data in Cloudflare Workers AI GLM‑5.3 Model

Cloudflare Workers AI’s GLM‑5.3 model returned fragments of other customers' prompts when processing very long inputs, due to a KV‑cache size mismatch and a bug in the SGLang inference engine. The leak affected 155 responses and was remediated within 24 hours. This highlights the importance of validated configuration and tenant‑isolation controls for audit readiness.

LiveThreat™ Intelligence · 📅 November 18, 2026· 📰 blog.cloudflare.com
🟡
Severity
Medium
BR
Type
Breach
🎯
Confidence
High
🏢
Affected
2 sector(s)
✅
Actions
2 recommended
📰
Source
blog.cloudflare.com

Cross‑Tenant KV Cache Leak Exposes Data in Cloudflare Workers AI GLM‑5.3 Model

What Happened — Between 27 August 2026 and 9 September 2026 Cloudflare’s Workers AI service ran the GLM‑5.3 model with a KV‑cache pool that was smaller than the model’s advertised 1,048,576‑token context window. When very long prompts (> 681,280 tokens) were submitted, a bug in the open‑source SGLang inference engine allowed rejected requests to continue through the disaggregated pre‑fill/​decode pipeline, causing the decode node to read stale KV pages that still contained data from earlier customers. As a result, 155 responses returned fragments of other tenants’ prompts. Cloudflare detected the issue via a HackerOne report, took the model offline, applied a configuration fix and a patched engine, and restored service on 9 September 2026.

On September 8 2026, Cloudflare’s security team was notified by researcher Gadi Evron of Knostic that the GLM‑5.3 model hosted on Workers AI ( @cf/zai‑org/glm‑5.3 ) was leaking data between users. The problem had been present since August 27 2026, and between those dates a small subset of customers received responses that incorporated text from other users’ requests. In total, 155 replies were affected, all generated for prompts exceeding 681,280 tokens. After removing internal test traffic and the researcher’s own queries, the remaining requests appeared to be ordinary long‑context usage rather than a targeted exploit, and Cloudflare found no evidence of deliberate abuse.

The root cause was a combination of a configuration mismatch and a bug in the open‑source inference engine SGLang. GLM‑5.3 was deployed with a 1,048,576‑token context window, but the KV‑cache pool on the prefill GPUs could only hold 681,280 tokens. Although Cloudflare knew of the mismatch, it expected SGLang to reject oversized prompts with an error; internal long‑context tests had returned successful results, so the issue was not flagged. When a prompt overflowed the pool, SGLang marked the request as rejected and substituted a one‑token placeholder, but instead of aborting it continued to generate a KV cache for the placeholder and transferred that cache to the decode node. The decode node interpreted the “transfer complete” signal as if the full prompt had been processed, leaving most of the previous cache pages untouched. Consequently, the decode stage attended to stale pages that still contained data from earlier sessions, allowing responses to long prompts to leak other users’ content.

Cloudflare took the model offline within 40 minutes of confirming the incident and restored it on September 9 after applying two mitigations. First, the KV‑cache pool was enlarged to roughly 2.04 million tokens—about twice the model’s 1,048,576‑token context length—by aligning the GLM‑5.3 configuration with that of GLM‑5.2, thereby eliminating the rejection path for valid requests. Second, the SGLang engine was patched so that any request flagged for rejection is terminated before any allocation or KV‑cache transfer occurs. The fix was contributed upstream as pull request #38704, with related changes already merged in #36988 (September 6) and #38935, which enforce early rejection and verify token counts on the decode side. Cloudflare validated both adjustments using the researcher’s reproduction script and internal canary‑marker tests before bringing the model back online.

Workers AI serves GLM‑5.3 in a disaggregated setup: a pool of prefill GPUs builds the KV cache for the prompt, then hands it over via Mooncake RDMA to a separate pool of decode GPUs that generate the output. The KV cache resides in a shared pool of fixed‑size pages that are not zeroed between requests; ownership of these pages is tracked by the inference engine. Because the pool size is derived from available GPU memory at startup rather than a fixed configuration, it can diverge from the advertised context length, placing the onus on operators to verify alignment. Cloudflare confirmed that no other model on Workers AI was impacted by the flaw.

On the GLM‑5.3 prefill nodes the configured KV cache held 681,280 tokens, while the model’s maximum context window was 1,048,576 tokens. SGLang printed the selected KV pool size in its startup logs and exposed it as a metric, so the mismatch was visible to operators. During pre‑launch testing the team only verified that HTTP responses returned successful status codes and that the streaming body contained no error frames, leading them to assume the engine could silently handle the difference between the KV pool and the requested context length.

The underlying defect was in SGLang’s handling of prompts that exceeded the KV pool. In versions prior to v0.5.21, when a prompt was longer than the pool, the scheduler rejected the request, recorded an error, and swapped the prompt for a one‑token placeholder so the request could flow through the normal batching pipeline without allocating real memory. On a single‑node deployment the placeholder ran, the batch completed, and the client received an error as expected. In the disaggregated deployment used by Cloudflare, however, the admission queues on both prefill and decode nodes checked only whether a request was “finished” and not whether it had been rejected. Consequently, a rejected request was mistakenly treated as live, causing the decode node to reserve KV pages for the full prompt length, receive only the placeholder page from the prefill node, and then read stale data left by earlier users in the remaining pages. The client consequently received an HTTP 200 response, a prompt token count matching the long input, and a coherent reply that arrived faster than a true eight‑page prefill should have, but which contained fragments from other users’ KV pages.

The issue was first reported to the SGLang project as issue #30233 on July 6 2026, a report that Cloudflare discovered while investigating the incident. The bug had been flagged by Cloudflare since SGLang v0.5.10, and the security incident accelerated collaborative work with the SGLang team. A fix was shipped in SGLang v0.5.20, with additional refinements in v0.5.21 and v0.5.22; Cloudflare now advises all operators to upgrade to v0.5.22 or later. The patch corrects the scheduler’s error handling so that rejected requests are not admitted to the decode queue and adds per‑transfer checksums and proper abort‑ACK preservation.

Only the GLM‑5.3 model was vulnerable because it was the sole deployment where the prefill KV pool was smaller than the context length. All other disaggregated Workers AI models have KV pools that meet or exceed their context windows, so they never triggered the rejection path. Cloudflare has applied the engine fix and the hardening measures to every model served with SGLang, and the deployment pipeline now enforces KV‑pool‑vs‑context checks before any change is released.

The incident timeline (all times UTC) began with the GLM‑5.3 launch on August 27 2026, when the undersized KV pool was first introduced. A HackerOne report arrived on September 8 2026 at 23:11, prompting Cloudflare to start verification at 08:00 on September 9. By 13:22 the security team declared an incident and reproduced the leak using two independent accounts within 25 minutes. At 14:00 the model was set to private, returning HTTP 400 for all requests, and the status page was updated. By 14:35 the root cause—an undersized prefill pool—was identified, and a canary node with a larger pool confirmed the issue was not present. All prefill nodes were reconfigured by 14:52, and a full deployment rebuild with a Cloudflare‑authored engine patch was completed by 19:04, after which the model was restored to public at 19:40. Subsequent meetings with SGLang maintainers on September 10 led to upstream fixes merged between September 16 and October 12, followed by the releases of SGLang v0.5.21 on October 2 and v0.5.22 on October 19. A coordinated public disclosure occurred on October 26.

Cloudflare notes that this bug belongs to a broader class of KV‑cache memory‑safety issues where a page is freed, reused, or read while another component still holds a claim on it. Similar problems have arisen from page‑lifetime mismatches on decode nodes, such as concurrent token generation, host‑memory offload, KV‑transfer receipt, and abort paths. Earlier patches addressing decode offload (issues #24226, #30899) and double release on grammar errors (issue #30937) targeted the same underlying pattern. Ongoing hardening efforts continue to enforce stricter page‑ownership checks across all production SGLang deployments.

The underlying problem was a cross‑node race: when a pre‑fill request was aborted while its KV cache was still being written over RDMA, the in‑flight writes could not be withdrawn. If the decode stage freed those pages immediately, they could be reassigned to a different request, allowing the stray writes to corrupt that request’s KV cache. Cloudflare had already contributed fixes for a similar timing‑based race (GitHub #31357, #38961) and a reproduction script (GitHub #32564), which produced either garbled output or a user’s data appearing in another user’s response without raising an error. The incident differed because a rejected request was repeatedly handed off, causing decode to read pages that had never been written for that request.

Since the breach, Cloudflare extended the deferred‑release mechanism to retain the pre‑fill source pages for every failure type, not just aborts, and pushed the change upstream as #38961, later superseded by #40645, #41402, and #41404. The team also deployed bounded Mooncake transfer batches (SGLang #32758) to ensure no single transfer call could exceed the release timeout, and re‑engineered the load balancer so a client disconnect no longer aborts a request mid‑transfer; the pre‑fill connection now stays open until completion and the decode connection remains until the first token is emitted. Additional safeguards were added to every disaggregated deployment, including KV‑pool‑size checks against context length, deferred release on both pre‑fill and decode roles, transfer‑batch limits within the timeout, and verification that all required patches were applied. All of these updates have been rolled out to production disaggregated deployments.

Cloudflare met with the SGLang maintainers at RadixArk on September 10, the day after the incident, and agreed that RadixArk would investigate the reported race conditions, upstream the integrity‑checking concept, and create reproducible tests. The collaboration resulted in a series of pull requests that landed on SGLang’s main branch, most of which are included in version v0.5.22. Notable changes include #36988 (v0.5.20) which retires aborted pre‑fill requests before they reach decode, #38935 (v0.5.21) which rejects oversized requests at admission, and a set of race‑condition fixes such as #39461 and #41612 (v0.5.21/22) that make the router cancel both halves of a request on client disconnect or pre‑fill failure. Other key updates are #37454 and #41023 (v0.5.20/21) enabling deferred KV release by default on supporting backends, #40645 and #41402 (v0.5.21) correcting lost drain confirmations, #41404 (v0.5.21) holding pages on any transfer failure, and #32758 (v0.5.20) adding an optional cap on Mooncake batch size. Observability improvements such as #39500 (v0.5.21) introduce a KV‑checksum flag for decode, while #41128 (v0.5.22) adds metrics on deferred‑release outcomes.

Operators running SGLang in a disaggregated pre‑fill/decode configuration are advised to verify that their KV pool exceeds the maximum context length on every node, to upgrade to a build containing #36988 and #38935 (v0.5.22 or later), to enable deferred KV release on both roles, and to bound Mooncake transfer batches. Enabling corruption detection with --disaggregation-enable-kv-checksum and --kv-canary is recommended, though support varies by model architecture. Finally, load balancers should be configured to avoid premature aborts, allowing requests to proceed until the first token is generated. In the longer term, Cloudflare stresses “integrity by construction”: the engine should detect at read time when a request is about to access a page it does not own and fail that request rather than leaking another user’s data.

The prototype for a cross‑request KV cache integrity check was assembled during the summer and publicly described in August. Each physical KV page now carries a mutable tag that flips when the page is reallocated; every request logs the tags it expects and the mapping is verified before the decode stage reads from the cache. In internal benchmarks the added overhead was under 1 % for both throughput and tail latency, and the approach was exercised on GLM 5.2 in mid‑August before being disabled shortly thereafter because of reliability concerns. Because the early design was tied to particular attention back‑ends and model architectures, it could not serve as a universal remedy, prompting a collaboration with the SGLang team to embed a production‑grade solution across all models rather than relying on Cloudflare‑specific patches. The per‑transfer checksum introduced in issue #39500 represents the first step, confirming the handoff from prefill to decode, while the page‑level tags extend verification to every subsequent read, even long after the initial transfer.

The underlying failure stemmed from an RDMA‑based consistency bug: RDMA moves data directly between node memories, requiring both ends to agree on destination address, data size, and completion timing. A mismatch in these parameters caused one machine to read incorrect data, exemplifying a distributed‑system consistency failure where the two nodes held divergent views of the system state.

Cloudflare has been applying formal verification to its distributed infrastructure elsewhere, citing Topaz for conflict‑free IP selection in authoritative DNS and Meerkat’s QuePaxa models that uncovered and helped fix consistency bugs. Building on that experience, the team plans to model and prove the safety of the RDMA‑based KV cache transfer protocol using the Mooncake verifier. The objective is to capture the production SGLang distributed KV cache system in a formal model, identify any deviations from defined safety properties, and close those gaps—recognizing that provers may leave some residual uncertainty, but that proving the bulk of the system will enable tighter monitoring of any remaining risks.

The disclosure was coordinated with researcher Gadi Evron, who reported the issue through Cloudflare’s HackerOne program with a reproducible script and allowed time for remediation before public release. The SGLang team at RadixArk also treated the flaw as their own, delivering upstream fixes promptly. The report invites anyone who discovers a Workers AI security problem to submit it via hackerone.com/cloudflare, and notes that further work will focus on formal verification to ensure such consistency failures cannot recur.

Why It Matters for Trust & Control Assurance — The incident shows how a mis‑aligned configuration and an un‑handled error path can break tenant isolation, underscoring the need for continuous configuration validation and evidence‑driven control mapping.

Who Is Affected — AI SaaS platforms that host multi‑tenant large language models; enterprises that consume such models through Cloudflare Workers AI or similar services.

Recommended Actions

  • Verify that KV‑cache pool sizes always meet or exceed the model’s context length before deployment.
  • Automate configuration checks and retain logs as audit evidence of tenant‑isolation controls.
  • Apply the latest SGLang patches (≥ v0.5.22) and incorporate upstream fixes into your CI/CD pipeline.
  • Conduct a post‑incident review to map the isolation control to your audit framework and document remediation steps.

Source: Cloudflare Security Blog

Technical Notes

  • Vector: Misconfiguration of KV‑cache pool + bug in SGLang’s rejection handling in disaggregated pre‑fill/​decode mode.
  • Impact: Data from other customers appeared in responses to prompts > 681,280 tokens (155 total responses).
  • Remediation: Increased KV pool to 2.04 million tokens, patched SGLang to abort rejected requests before KV transfer, added upstream admission checks.

Source: Cloudflare Security Blog

📰 Original Source
https://blog.cloudflare.com/kv-cache-exposure-remediation/ ↗

This LiveThreat Intelligence Brief is an independent analysis. Read the original reporting at the link above.

From the Verisq platform · Trust Operations

Every gap like this maps to a control you can evidence.

The Verisq AI Trust Operations platform maps incidents to your control framework and collects the evidence continuously — so your Trust Center shows proof, not promises, when a buyer or auditor asks.

Explore the Verisq AI Trust Operations platform →