Skip to main content

When Agentic Glue Melts: Exploiting Cloudflare Code Mode and Workers

0
Critical
Vulnerabilityjavascriptai
Published: 08/06/2026 (08/06/2026, 22:20:00 UTC)
Source: Check Point Research

Description

By Yarden Porat, Check Point Research Key Points Check Point Research analyzed Cloudflare Code Mode, a technique that changes how AI agents use MCP by turning tools into a TypeScript API the model can write code against. The research uncovered five vulnerabilities in workerd, the open-source runtime behind Code Mode and Cloudflare Workers. Two were rated Critical by Cloudflare. The blast radius is broad: by Cloudflare’s own numbers, Workers is built by millions of developers ,[1] serves millions of requests per second ,[2] and carries more than 10% of all traffic on Cloudflare’s network .[3] Because workerd underpins both Code Mode sandboxes and Workers tenant isolation, the findings create sandbox-escape and cross-tenant exposure risk. Cloudflare’s managed Workers environment has been fixed in production. Self-hosted workerd / Code Mode deployments should update to v1.20260619.1. Check Point Research released proof-of-concept code as part of its Black Hat USA 2026 presentation. The short version We set out to break Cloudflare Code Mode , and ended up breaking Cloudflare Workers too. We did both by targeting workerd , the runtime beneath both: an in-process sandbox that relies entirely on V8 to isolate untrusted code. We found five memory-corruption bugs in workerd’s native C++ (the “glue” between JavaScript and the runtime), and turned them into two end-to-end attacks: Cross-tenant heap swipe. An out-of-bounds read in URLPattern lets one Worker reach across the shared process heap and swipe another tenant’s secrets . Code Mode sandbox escape. Starting from a prompt injection, a use-after-free in node:zlib breaks out of the sandbox and runs native code on the host . Part I – Understanding the target 1. Where this started: Code Mode Code Mode is Cloudflare’s take on LLM tool use. Instead of a model emitting structured tool calls one at a time, Code Mode exposes the available tools as a typed TypeScript API and lets the model write code that calls them: loops, conditionals, data shuffling and all. In the traditional MCP / tool-calling loop, the model emits one {tool, args} call, the agent runs it, feeds the result back. The model then emits the next call. Every step is a fresh model invocation, and usually a network round-trip. Code Mode collapses that: the model writes one program that orchestrates many tool calls itself (looping, branching, and combining intermediate results locally) and only the final output returns to the model. Cloudflare’s argument is that LLMs, trained on enormous amounts of real-world code, are simply better at writing a program against a typed API than at emitting long chains of synthetic tool calls. [4] Figure 1 – Tool calling vs. Code Mode That code has to run somewhere, and that “somewhere” is workerd , the runtime behind Cloudflare Workers. 2. The workerd origin story To understand workerd, start with the product it was built for: Cloudflare Workers . Workers is Cloudflare’s serverless platform: you upload a piece of code and Cloudflare runs it at the edge , in data centers close to the user, on demand for every request. There’s no server to manage and, ideally, no cold machine to wait for. That model creates a hard isolation problem. Cloudflare runs code from a huge number of different customers, and to keep latency and cost down it packs many of them onto the same machines, and, as we’ll see, into the same process. The classic answer (a container or VM per tenant) is far too heavy for this: each one adds tens to hundreds of milliseconds of cold start and a real memory footprint, which is exactly what an edge platform serving oceans of short requests cannot afford. Cloudflare’s answer is to isolate at the language-runtime level rather than the OS level, using V8 isolates, the same primitive Chrome uses to separate browser tabs. An isolate is a lightweight, independent JavaScript context. Many can live inside a single process, each starts in single-digit milliseconds, and the isolate is the security…

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/15/2026, 05:04:41 UTC

Technical Analysis

Check Point Research analyzed Cloudflare Code Mode and discovered five memory corruption vulnerabilities in workerd, the runtime underlying both Code Mode and Cloudflare Workers. These include an out-of-bounds read in URLPattern allowing cross-tenant heap data exposure and a use-after-free in node:zlib enabling sandbox escape to execute native code on the host. Cloudflare rated two of these vulnerabilities as critical. The vulnerabilities impact the in-process sandboxing model that uses V8 isolates to isolate tenant code within a shared process. Cloudflare has patched the managed Workers environment in production and recommends self-hosted workerd/Code Mode deployments update to v1.20260619.1. Proof-of-concept exploit code was released by Check Point Research.

Potential Impact

The vulnerabilities allow attackers to bypass sandbox isolation and access memory belonging to other tenants, potentially exposing sensitive data across tenants. Additionally, sandbox escape vulnerabilities enable execution of native code on the host, compromising the underlying system. Given Cloudflare Workers serves millions of requests per second and handles over 10% of Cloudflare's network traffic, these vulnerabilities pose significant risks to confidentiality and integrity in multi-tenant environments.

Mitigation Recommendations

Cloudflare has fixed these vulnerabilities in their managed Workers environment in production. Self-hosted workerd and Code Mode deployments should update to version v1.20260619.1 to remediate these issues. Users should follow Cloudflare's official guidance and update accordingly. No additional mitigation steps are indicated beyond applying the official fixes.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Classification
{"confidence":0.71,"severitySource":"stated","classifier":"rss-v2"}
Article Source
{"url":"https://research.checkpoint.com/2026/when-agentic-glue-melts/","fetched":true,"fetchedAt":"2026-08-07T18:01:59.027Z","wordCount":6521}

Threat ID: 6a761d97bf8831d539d5300c

Added to database: 08/07/2026, 18:01:59 UTC

Last enriched: 08/15/2026, 05:04:41 UTC

Last updated: 09/20/2026, 02:32:37 UTC

Views: 138

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses