Skip to content
Memory corruption Advisory Advanced CVE-2026-6919

Use after free in DevTools (CVE-2026-6919)

A compromised renderer could send duplicate ChildTargetCreated messages for the same dedicated worker token through different DevTools channels, causing a use-after-free in the browser process. When the user opens DevTools and the frame navigates, the browser dereferences a freed pointer, leading to a crash.

c6eed09fc8b174b0f3eebedcceb1e792 Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 36 days

Use-after-free in DevToolsRendererChannel::ForceDetachWorkerSessions via duplicate ChildTargetCreated for dedicated workers

Summary

A compromised renderer can trigger a use-after-free in the browser process by sending duplicate blink.mojom.DevToolsAgentHost.ChildTargetCreated messages for the same dedicated worker token through different DevTools channels. The dedicated worker branch in ChildTargetCreated lacks the duplicate-token validation that the worklet branch enforces, allowing a single DedicatedWorkerDevToolsAgentHost to be inserted into multiple child_targets_ sets while its destroyed_callback_ is silently overwritten. When the host object is freed, one channel retains a dangling pointer. A subsequent frame navigation calls ForceDetachWorkerSessions, which dereferences this pointer in the browser process. The vulnerability affects all desktop platforms (Linux, Windows, macOS, ChromeOS) and requires only that the user opens DevTools (F12) on the compromised tab. Threat model: compromised renderer / sandbox escape.

Bisect

Introducing Commit: 1598b6392def1a0d33fb485d78e463875e414655

Root Cause

When a dedicated worker is created and DevTools is attached, the renderer sends a ChildTargetCreated IPC to the browser. The browser-side handler in DevToolsRendererChannel::ChildTargetCreated looks up the corresponding DedicatedWorkerDevToolsAgentHost by token, calls ChildWorkerCreated to register a destruction callback, rebinds the host's Mojo pipes via SetRenderer, and inserts the host's raw pointer into the channel's child_targets_ set:

C++
// content/browser/devtools/devtools_renderer_channel.cc:185-225
case blink::mojom::DevToolsExecutionContextType::kDedicatedWorker: {
  DedicatedWorkerDevToolsAgentHost* dedicated_worker_agent_host =
      WorkerDevToolsManager::GetInstance().GetDevToolsHostFromToken(
          devtools_worker_token);
  if (!dedicated_worker_agent_host)
    return;
  dedicated_worker_agent_host->ChildWorkerCreated(
      url, name,
      base::BindOnce(&DevToolsRendererChannel::ChildTargetDestroyed,
                     weak_factory_.GetWeakPtr()));
  agent_host = dedicated_worker_agent_host;
  break;
}
agent_host->SetRenderer(process_id_, std::move(worker_devtools_agent),
                        std::move(host_receiver));
child_targets_.insert(agent_host.get());

The worklet branch guards against duplicate tokens with an explicit check that calls ReportBadMessage and returns early. The dedicated worker branch has no such guard. GetDevToolsHostFromToken performs a global lookup by token with no validation of the caller's identity, so any channel in the same process can retrieve the same host object. ChildWorkerCreated unconditionally overwrites the single destroyed_callback_ member:

C++
// content/browser/devtools/worker_or_worklet_devtools_agent_host.cc:55-62
void WorkerOrWorkletDevToolsAgentHost::ChildWorkerCreated(
    const GURL& url, const std::string& name,
    base::OnceCallback<void(DevToolsAgentHostImpl*)> callback) {
  url_ = url;
  name_ = name;
  destroyed_callback_ = std::move(callback);
}

The child_targets_ container uses raw_ptr<WorkerOrWorkletDevToolsAgentHost, CtnExperimental>, which maps to kMayDangle and disables Chromium's internal dangling-pointer detection.

The attack proceeds as follows. The compromised renderer creates a dedicated worker, causing the parent frame's DevTools channel to send the normal ChildTargetCreated with the worker's token. The browser inserts the host pointer into the frame channel's child_targets_ and sets destroyed_callback_ to point back at that channel. Meanwhile, the worker's own DevToolsAgent receives a host_remote_ Mojo endpoint connected to the host's own DevToolsRendererChannel. Through this endpoint, the compromised renderer sends a second ChildTargetCreated carrying the same token but with throwaway Mojo pipe endpoints. The browser processes this on the host's channel, overwriting destroyed_callback_ and rebinding the host's Mojo connection to the throwaway pipes. When the throwaway pipes are immediately destroyed on the renderer side, the browser's agent_remote_ disconnect handler fires Disconnected, which invokes the overwritten callback, removing the host only from its own channel's child_targets_. The frame channel's child_targets_ still holds the pointer. After the renderer terminates the worker, WorkerDevToolsManager::WorkerDestroyed erases the host from its hosts_ map, dropping the last reference and freeing the object. On the next same-origin navigation of the frame, ReadyToCommitNavigation calls ForceDetachWorkerSessions, which iterates the frame channel's child_targets_ and dereferences the freed host:

C++
// content/browser/devtools/devtools_renderer_channel.cc:76-80
void DevToolsRendererChannel::ForceDetachWorkerSessions() {
  for (WorkerOrWorkletDevToolsAgentHost* host : child_targets_) {
    host->ForceDetachAllSessions();
  }
}

This virtual call reads the vtable pointer from freed memory, producing a heap-use-after-free in the browser process.

Reproduce

Tested at commit d0f83d769eeed on macOS arm64 (also confirmed on Linux x86_64) with an ASAN build:

is_asan = true
is_debug = false
is_component_build = true
dcheck_always_on = true

The PoC requires a renderer-side source modification (patch.diff) that replays the ChildTargetCreated IPC through the worker's own DevTools pipe, simulating a compromised renderer.

1. Apply patch and build

cd ~/chromium/src
git apply patch.diff
autoninja -C out/asan-release chrome

2. Start HTTP server

cd ~/issue_devtools_childtarget_uaf
python3 -m http.server 18035 &

3. Launch Chrome

  • macOS:
ASAN_OPTIONS=detect_odr_violation=0 \
~/chromium/src/out/asan-release/Chromium.app/Contents/MacOS/Chromium \
  --enable-logging=stderr \
  http://localhost:18035/poc.html
  • Linux:
ASAN_OPTIONS=detect_odr_violation=0 \
~/chromium/src/out/asan-release/chrome \
  --enable-logging=stderr \
  http://localhost:18035/poc.html

4. Trigger

Open DevTools on the tab (F12 or Cmd+Option+I). The PoC page automatically creates a worker, triggers the duplicate IPC, terminates the worker, and navigates. The browser process crashes within 15 seconds.

=================================================================
==4176353==ERROR: AddressSanitizer: heap-use-after-free on address 0x7cfbb38b7980 at pc 0x7f8c16791b0a bp 0x7ffd8c1de3b0 sp 0x7ffd8c1de3a8
READ of size 8 at 0x7cfbb38b7980 thread T0 (chrome)
    #0 0x7f8c16791b09 in content::DevToolsRendererChannel::ForceDetachWorkerSessions() content/browser/devtools/devtools_renderer_channel.cc:81:11
    #1 0x7f8c169ecd9a in content::RenderFrameDevToolsAgentHost::ReadyToCommitNavigation(content::NavigationHandle*) content/browser/devtools/render_frame_devtools_agent_host.cc:510:25
    #2 0x7f8c1825a7b3 in void content::WebContentsImpl::WebContentsObserverList::NotifyObservers<void (content::WebContentsObserver::*)(content::NavigationHandle*), content::NavigationHandle*&>(void (content::WebContentsObserver::*)(content::NavigationHandle*), content::NavigationHandle*&) content/browser/web_contents/web_contents_impl.h:1833:9
    #3 0x7f8c1825b75d in content::WebContentsImpl::ReadyToCommitNavigation(content::NavigationHandle*) content/browser/web_contents/web_contents_impl.cc:7431:14
    #4 0x7f8c178bcc95 in content::NavigationRequest::ReadyToCommitNavigation(bool) content/browser/renderer_host/navigation_request.cc:8990:20
    #5 0x7f8c178b3e03 in content::NavigationRequest::CommitNavigation() content/browser/renderer_host/navigation_request.cc:6716:3

0x7cfbb38b7980 is located 0 bytes inside of 648-byte region [0x7cfbb38b7980,0x7cfbb38b7c08)
freed by thread T0 (chrome) here:
    #0 0x55ace64339e2 in operator delete(void*, unsigned long)
    #1 0x7f8c16a2dcd5 in std::__Cr::__tree<...>::erase(...) base/memory/ref_counted.h:375:5
    #2 0x7f8c184c4614 in content::DedicatedWorkerHost::~DedicatedWorkerHost() content/browser/worker_host/dedicated_worker_host.cc:190:40
    #3 0x7f8c184c5652 in content::DedicatedWorkerHost::OnMojoDisconnect() content/browser/worker_host/dedicated_worker_host.cc:245:3

previously allocated by thread T0 (chrome) here:
    #0 0x55ace6432ddd in operator new(unsigned long)
    #1 0x7f8c16a2caac in base::MakeRefCounted<content::DedicatedWorkerDevToolsAgentHost, ...>(...) base/memory/scoped_refptr.h:151:12
    #2 0x7f8c16a2c689 in content::WorkerDevToolsManager::WorkerCreated(...) content/browser/devtools/worker_devtools_manager.cc:54:18

SUMMARY: AddressSanitizer: heap-use-after-free content/browser/devtools/devtools_renderer_channel.cc:81:11 in content::DevToolsRendererChannel::ForceDetachWorkerSessions()

Credit

Please use c6eed09fc8b174b0f3eebedcceb1e792 as the credit for this vulnerability. Thank you.

The original report as published on the Chromium issue tracker, by c6eed09fc8b174b0f3eebedcceb1e792. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The dedicated worker branch of ChildTargetCreated lacks duplicate-token validation, allowing the same host object to be inserted into multiple child_targets_ sets and its destruction callback to be overwritten, leaving a dangling pointer.

Impact

A compromised renderer could cause a heap-use-after-free in the browser process, leading to a crash, and potentially a sandbox escape.

What the attacker needed

Compromised renderer; user opens DevTools on the tab

How it was found

  1. Apply the provided patch and build Chrome with ASAN.
  2. Start a local HTTP server serving the PoC page.
  3. Launch Chrome pointing to the PoC page.
  4. Open DevTools on the tab (F12 or Cmd+Option+I).
  5. The PoC page automatically creates a worker, triggers the duplicate IPC, terminates the worker, and navigates, causing a crash.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A use-after-free is a memory bug where a program keeps a pointer to memory after it has been freed, then later uses it. Here, a malicious web page (running in a compromised part of the browser) tricks the browser into freeing an object but leaving a stale pointer behind. When the user opens the developer tools and navigates, the browser follows that stale pointer and crashes.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by c6eed09fc8b174b0f3eebedcceb1e792

View all

52 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.