# "When Agentic Glue Melts": Five workerd Memory-Corruption Flaws Enable Cross-Tenant Secret Theft and Code Mode Sandbox Escape on Cloudflare Workers

> Check Point Research disclosed five vulnerabilities in workerd, the runtime behind Cloudflare Workers and Cloudflare Code Mode: a URLPattern out-of-bounds read (two variants), a zlib deflateParams() use-after-free, an HTMLRewriter AttributesIterator use-after-free, and a Durable Objects KV SQL-authorizer bypass enabling arbitrary deserialization. Chained, the flaws allow cross-tenant API-credential theft via heap spraying and a Code Mode sandbox escape to native ARM64 code execution on the host; Cloudflare rated two of the five Critical, patched managed Workers in production, and shipped self-hosted fix v1.20260619.1.

- **Published:** 2026-08-06T00:00:00Z
- **Last reviewed:** 2026-08-06T00:00:00Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-1924
- **Card image:** https://intel.threadlinqs.com/og/threat/threat-intel-workerd-sandbox-escape-tl-2026-1924.webp?v=c99e15af (Threadlinqs threat intel: Cloudflare workerd Sandbox Escape: Detection & IOCs (TL-2026-1924) — Critical severity, 13 IOCs, 9 detection rules.)
- **ID:** TL-2026-1924
- **Severity:** CRITICAL
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 13 (2 shown free below)

## Description

Check Point Research researchers Yarden Porat and Shahar Tal presented "When Agentic Glue Melts: Exploiting Cloudflare CodeMode and Workers" at Black Hat USA 2026 (Mandalay Bay, Las Vegas, August 6, 2026, 3:35 PM PT), detailing five memory-corruption and logic flaws in workerd, the open-source JavaScript/WebAssembly runtime that underlies both the Cloudflare Workers serverless platform and Cloudflare Code Mode (a feature that exposes Worker bindings to LLM agents as a typed TypeScript API the model writes and executes code against, rather than emitting sequential structured tool calls).

The five root causes: (1) a URLPattern out-of-bounds read caused by a nested-capture-group count mismatch between workerd's parser and V8's regex engine — a pattern such as `/(ab(cde))/` produces two capture groups in V8's regex engine but is counted as one by workerd's URLPattern group list — exploitable in both the original and Ada-backed URLPattern implementations, that yields an arbitrary-memory-read primitive by treating out-of-bounds bytes as a kj::String (pointer+size+disposer); (2) a use-after-free write in the node:zlib binding's deflateParams(), where the z_stream structure retains a stale next_out pointer after write() completes, so a subsequent params() call flushes buffered output through the dangling pointer into freed memory whose output-offset parameter allows targeting an exact field within the reused object (rated Critical by Cloudflare); (3) a use-after-free read in HTMLRewriter's AttributesIterator, which holds a raw pointer into an element's attribute array that is freed on reallocation when setAttribute() calls grow the array beyond capacity, surfacing on the iterator's next next() call (rated Critical by Cloudflare); (4) a Durable Objects SQL-authorizer bypass that validates table names in queries but not in ALTER TABLE RENAME TO, letting an attacker create a table under a permitted name, populate it with crafted bytes, and rename it into the protected _cf_KV namespace; and (5) an arbitrary-deserialization flaw reachable through that authorizer bypass, where the crafted bytes reach workerd's internal V8 deserializer, which is built for trusted input only.

Two exploit chains were demonstrated. The cross-tenant secret-theft chain deploys a malicious Worker into a shared compute pool, calls pattern.exec() on the crafted nested-group regex to trigger the URLPattern OOB read, constructs a fake kj::String from freed tcmalloc chunks to leak a real heap address, defeats ASLR by reading tcmalloc free-list "next" pointers, shapes the heap using VFS file allocations to place attacker-controlled data adjacent to target objects, and abuses in-place VFS file-content modification (no reallocation) to build a repeatable read primitive that sweeps a co-located tenant's heap for strings matching the API-token pattern `Bearer sk…`. This works because, per Cloudflare's own confirmation, the tcmalloc heap sits outside both the V8 sandbox ("cage") and hardware memory-protection keys, so a read primitive that escapes V8 isolation also escapes cross-tenant memory protection. The Code Mode sandbox-escape chain begins with prompt injection steering an LLM agent into generating attacker-controlled TypeScript that Code Mode executes; the script calls handle.write() with Z_NO_FLUSH to leave compressed data pending, then calls handle.params() to trigger deflateParams(), flushing through the stale next_out pointer into a freed slot holding FileImpl metadata; the UAF write corrupts that FileImpl's data.size field to inflate its bounds, yielding out-of-bounds file read/write that is used to corrupt a second FileImpl's data.ptr field, achieving an arbitrary process-memory read/write primitive via the second file's API; the exploit then writes ARM64 shellcode into V8's fixed RWX region at address 0xaaaaf0000000 and hijacks the zlib stream's native write-callback pointer so that a further handle.write() call redirects execution into the shellcode (Check Point's self-hosted demo used this to launch an example reverse shell). This specific RCE chain requires a self-hosted workerd compiled with the V8 sandbox disabled, which produces a single heap layout where ArrayBuffer and native objects overlap; no C2 infrastructure, persistence mechanism, or victim-scanning/reconnaissance step is described — both chains assume co-location on shared compute or a directly targeted self-hosted deployment.

Four of the five bugs (zlib UAF, HTMLRewriter UAF, both URLPattern OOB variants) were reported to Cloudflare via HackerOne on 2026-02-01; Cloudflare rated the zlib and HTMLRewriter UAFs Critical on 2026-03-11; the fifth bug (KV SQL-authorizer bypass) was reported 2026-03-12. As of public disclosure, Cloudflare had not assigned CVE identifiers to any of the five issues. Cloudflare's managed Cloudflare Workers environment was patched in production ahead of disclosure; self-hosted workerd deployments must upgrade to v1.20260619.1 (released 2026-06-19, commit 45da9a12af02ef39a1d6448139823728cf4f2cf9, PR #6822) to remediate. Check Point published five standalone proof-of-concept exploits, one per vulnerability, on GitHub (yardenporat353/WhenAgenticGlueMeltsPOCs) alongside the Black Hat presentation — each PoC directory ships a Vulnerability.md root-cause writeup, a Run.md build/execution guide, and a Dockerfile pinning the exact pre-patch vulnerable workerd build for reproducibility; the two OOB-read PoCs and the KV bypass PoC are rated High/Medium severity in the repo, while the zlib and HTMLRewriter UAF PoCs are rated Critical, matching Cloudflare's own severity assignment. The repository states the full arbitrary-deserialization exploit chain and both complete end-to-end attack chains are restricted to vetted researchers via Check Point Research directly (contact: shahartal@checkpoint.com).

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1059.007 JavaScript
- T1611 Escape to Host
- T1620 Reflective Code Loading
- T1212 Exploitation for Credential Access
- T1005 Data from Local System
- T1587.004 Exploits
- T1588.005 Exploits

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**workerd Durable Objects SQL-Authorizer Bypass and Native RWX Shellcode Staging** (`TL-2026-1924-SPL-002`)

Detects the Durable Objects KV SQL-authorizer bypass — an ALTER TABLE RENAME TO statement that moves an attacker-populated table into the protected _cf_KV namespace, reaching workerd's untrusted V8 deserializer (CWE-502/CWE-863) — and/or a self-hosted workerd process performing native RWX memory allocation (mmap/mprotect with PROT_EXEC, or activity at the fixed V8 RWX region 0xaaaaf0000000). This is the post-exploitation stage where the zlib deflateParams() use-after-free write is chained into a corrupted FileImpl to stage ARM64 shellcode ahead of execution.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1611, T1620
- **Data sources:** cloudflare_durable_objects_sql_logs, linux_auditd, microsoft_defender_for_endpoint_linux
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

```spl
index=cloudflare sourcetype="cloudflare:logpush:durable_objects_sql"
| where match(_raw, "(?i)ALTER\s+TABLE\s+\S+\s+RENAME\s+TO\s+_cf_KV")
| eval detection_reason="sql_authorizer_bypass"
| table _time, host, actorId, sqlStatement, detection_reason
| append
    [ search index=linux sourcetype="linux:audit" comm=workerd
      | where match(_raw, "(?i)(mmap|mprotect).*PROT_EXEC") OR match(_raw, "0xaaaaf0000000")
      | eval detection_reason="rwx_shellcode_staging"
      | table _time, host, comm, exe, detection_reason ]
| sort -_time
```

### Microsoft KQL

```kql
union
(
    CloudflareDurableObjectsSql_CL
    | where TimeGenerated > ago(24h)
    | where SqlStatement_s matches regex @"(?i)ALTER\s+TABLE\s+\S+\s+RENAME\s+TO\s+_cf_KV"
    | extend DetectionReason = "sql_authorizer_bypass"
    | project TimeGenerated, DeviceName = HostName_s, AccountName = ActorId_s, Detail = SqlStatement_s, DetectionReason
),
(
    DeviceProcessEvents
    | where TimeGenerated > ago(24h)
    | where FileName =~ "workerd"
    | where ProcessCommandLine has_any ("mmap", "mprotect", "PROT_EXEC", "0xaaaaf0000000")
    | extend DetectionReason = "rwx_shellcode_staging"
    | project TimeGenerated, DeviceName, AccountName, Detail = ProcessCommandLine, DetectionReason
)
```

### Sigma

```yaml
title: workerd Durable Objects SQL-Authorizer Bypass via ALTER TABLE RENAME TO _cf_KV or RWX Shellcode Staging
id: a1b2c3d4-2222-4a1b-9c2d-000000000002
status: experimental
description: Detects the SQL-authorizer bypass that renames an attacker-created table into the protected _cf_KV Durable Objects namespace, reaching workerd's untrusted V8 deserializer (CWE-502/CWE-863), or subsequent native RWX memory staging on self-hosted workerd hosts consistent with the zlib deflateParams()/HTMLRewriter use-after-free exploitation chain from the "When Agentic Glue Melts" disclosure.
references:
  - https://research.checkpoint.com/2026/when-agentic-glue-melts/
author: Threadlinqs Team
date: 2026-08-07
tags:
  - attack.privilege-escalation
  - attack.t1611
  - attack.defense-evasion
  - attack.t1620
  - attack.tool.workerd
  - cwe.502
  - cwe.863
logsource:
  category: process_creation
  product: linux
detection:
  selection_sql:
    SqlStatement|re: '(?i)ALTER\s+TABLE\s+\S+\s+RENAME\s+TO\s+_cf_KV'
  selection_shellcode:
    Image|endswith: '/workerd'
    CommandLine|contains:
      - 'mmap'
      - 'mprotect'
      - 'PROT_EXEC'
      - '0xaaaaf0000000'
  condition: selection_sql or selection_shellcode
falsepositives:
  - Legitimate Durable Objects schema migrations that happen to rename a table (validate target table name and calling principal)
  - Other JIT-compiled runtimes on the same host legitimately allocating RWX memory pages
level: critical
```

**Known false positives:**

- Legitimate Durable Objects schema migrations that rename an internal table (validate the target table name and requesting principal)
- Other JIT-compiled runtimes (e.g. V8, LuaJIT) on the same host legitimately allocating RWX memory pages

**Tuning notes:** Scope the ALTER TABLE RENAME TO match to statements targeting the literal _cf_KV table name (not table renames generally) and correlate with the calling Worker/Durable Object namespace to suppress legitimate schema-migration renames. Require both the SQL bypass and a subsequent RWX memory allocation from the same workerd host/session within a short window before escalating to a confirmed-chain alert, to reduce noise from unrelated JIT activity.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- workerd URLPattern Nested Capture-Group OOB-Read Exploit Pattern in Worker Script Deploy/Trace (locked: unlock with TL Creds)
- workerd Durable Objects SQL-Authorizer Bypass and Native RWX Shellcode Staging (locked: unlock with TL Creds)
- workerd Cross-Tenant Credential Theft and Anomalous C2-Style Egress (Code Mode Sandbox Escape) (locked: unlock with TL Creds)
- workerd URLPattern Nested Capture-Group OOB-Read Exploit Pattern in Worker Script Deploy/Trace (locked: unlock with TL Creds)
- workerd Durable Objects SQL-Authorizer Bypass and Native RWX Shellcode Staging (locked: unlock with TL Creds)
- workerd Cross-Tenant Credential Theft and Anomalous C2-Style Egress (Code Mode Sandbox Escape) (locked: unlock with TL Creds)
- workerd URLPattern Nested Capture-Group OOB-Read Exploit Pattern in Worker Script Deploy/Trace (locked: unlock with TL Creds)
- workerd Cross-Tenant Credential Theft and Anomalous C2-Style Egress (Code Mode Sandbox Escape) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (2 of 13)

Defanged, TLP:CLEAR.

- URL: `hxxps://github[.]com/yardenporat353/WhenAgenticGlueMeltsPOCs`
- File hash: `45da9a12af02ef39a1d6448139823728cf4f2cf9`

Full set of 13 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [When Agentic Glue Melts: Exploiting Cloudflare CodeMode and Workers](https://research.checkpoint.com/2026/when-agentic-glue-melts/)
- [yardenporat353/WhenAgenticGlueMeltsPOCs](https://github.com/yardenporat353/WhenAgenticGlueMeltsPOCs)
- [workerd v1.20260619.1 release](https://github.com/cloudflare/workerd/releases/tag/v1.20260619.1)
- [Black Hat USA 2026 Signals Agent Exploitation Has Become Its Own Infrastructure Discipline](https://forkast.news/black-hat-usa-2026-signals-agent-exploitation-has-become-its-own-infrastructure-discipline/)
- [Black Hat USA 2026 Signals Agent Exploitation Has Become Its Own Infrastructure Discipline](https://cryptorank.io/news/feed/0876d-black-hat-usa-2026-signals-agent-exploitation-has-become-its-own-infrastructure-discipline)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-1924
