V8
- JIT
- parser
- GC
- ArrayBuffer
Exploiting Cloudflare Code Mode & Workers
But now the model writes the code - the checkpoint still sees the calls, and nothing of the intent.
where does the model's code actually run?
Workers runs your code at the edge, on every request. workerd is the runtime underneath it.
Many customers, one machine, on demand for every request. A container each is far too heavy for that.
Like setting out to break an AI coding assistant - and going to audit Docker’s source instead.
Tenant separation on one software boundary.
workerd: two advisories, both Moderate.
Custom C++, reachable from untrusted JS.
Not just Code Mode. All of Workers.
The layers under the prompts.
Cloudflare developers (Q1 FY2026)
+1M in one quarter
agentic requests / month
“growing exponentially”
network requests use Workers
* July 2020. Cloudflare hasn’t restated a Workers traffic share since.A bug here is not contained to a feature.
* scope: V8’s memory.
where memory-unsafe glue meets attacker-written JS
Node.js trusts the application code that uses its APIs.
workerd
Web-standard API
const p = new URLPattern({ pathname: '/blog/:year/:month/:slug' });p.exec('https://example.com/blog/2025/03/post').pathname.groups;→ { year: '2025', month: '03', slug: 'post' }
/blog/:year/:month/:slug
↓compiles to
^/blog/([^/]+)/([^/]+)/([^/]+)$
/blog/:year/:month/:slug
→
/blog/:year/:month/(\d+)
→
raw regex is allowed - and an unnamed group has no name to give, so it gets an index
uint32_t length = array.size(); uint32_t index = 0; while (index < length) { groups.add({ name: nameList[index] }); ++index; }
const handle = new DeflateRaw();const input = Buffer.from("hello world");const output = Buffer.alloc(64);handle.write(input, output);
void setBuffers(ArrayPtr<byte> input, ArrayPtr<byte> output) { stream.next_in = input.begin(); // raw ptr → JS input buffer stream.next_out = output.begin(); // raw ptr → JS output buffer}
stream.next_out = nullptr;
missing
handle.stream.next_out
→
dangling ptr
write() againhandle.write(input, output2)next_out = output2
params()handle.params(level, strategy)deflateParams(&stream, …)let output = new Uint8Array(n)const h = new DeflateRaw()h.write(input, output, Z_NO_FLUSH)output = nullgc()const o = new Object()h.params(6, 0)from one out-of-bounds read to reading another tenant's secrets
kj::String { ptr, size, disposer }
→ read the bytes at ptr
ptr* No objects inside the cage were harmed in the making of this exploit.
• VFS - Virtual File System
• VFS - workerd backend for node:fs
• FileImpl - metadata of the file (VFS again)
reported and fixed - then what actually holds in production
4 of 5 - zlib, HTMLRewriter, two URLPattern OOBs.
zlib + HTMLRewriter: Critical. 2× CRITICAL
KV SQL bypass.
workerd v1.20260619.1. Managed Workers fixed first, on Cloudflare's side.
We asked. Their answer: this project does not assign CVEs, by policy.
Cloudflare confirmed: triggered in production.
We never ran it there. A crash takes co-tenants with it.
Would not work as-is on production.
Critical UAF → arbitrary R/W*
* self-hosted.
Very attainable. We stuck with the self-hosted demo. Maybe next year.
guardrail vendor allow-listed · usd < 50000
pay_invoice("Nord Supply", usd=48000)
allowed
a line in the invoice
pay_invoice("Nord Supply", usd=48000)
allowed
The cage protects the engine. Mind the glue.