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

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

A use-after-free occurs in V8 Inspector's console, exception, and promise reporting paths when a debugger session is disconnected while page JavaScript is on the stack. An attacker with a debugger client could potentially exploit this to cause a crash or, in some builds, achieve code execution.

yupyon.itome Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

Steps to reproduce the problem

Environment

V8 source: 15.1.0 (Chromium-tracked). Tested commit: f1d2db6bb88 (HEAD, 2026-06-04). Linux x86_64. Working tree unmodified (no source changes; all PoCs are stock harness JS).

Builds

UAF reproduction (callsites A-D) — out/fuzzbuild-sandbox-asan/args.gn:

is_debug = false
dcheck_always_on = false
v8_enable_sandbox = true
is_asan = true
target_cpu = "x64"

autoninja -C out/fuzzbuild-sandbox-asan inspector-test

Callsite B impact demo — out/fuzzbuild-sandbox/args.gn (non-ASan, because ASan quarantines the freed chunk and prevents the reclaim):

is_debug = false
dcheck_always_on = true
v8_enable_sandbox = true
target_cpu = "x64"

autoninja -C out/fuzzbuild-sandbox inspector-test

Run the UAF PoCs (A-D)

From the V8 source root, for each PoC:

ASAN_OPTIONS='abort_on_error=0:halt_on_error=1:detect_leaks=0' \
  ./out/fuzzbuild-sandbox-asan/inspector-test \
  test/inspector/protocol-test.js \
  poc-<X>.js

Each run aborts with AddressSanitizer: heap-use-after-free and a READ of size 8. Each report contains the deref-site stack, the freed-by stack through ~V8InspectorSessionImpl reached from UtilsExtension::DisconnectSession (inspector-test.cc:442), and the previously-allocated-by stack.

PoC console/JS trigger deref site freed region
A poc-A-wraparguments-session-stale.js console.log(a, b) (2 args) findInjectedScript v8-inspector-session-impl.cc:228 via wrapArguments :302 232 B V8InspectorSessionImpl, +24
B poc-B-consoleAPICalled.js console.log({...}) (1 arg) consoleAPICalled Runtime.cpp:478 via reportToFrontend :404 144 B V8RuntimeAgentImpl, +24 (frontend_channel_)
C poc-C-exceptionThrown.js uncaught throw {...} (via setTimeout) exceptionThrown Runtime.cpp:502 via reportToFrontend :363 144 B V8RuntimeAgentImpl, +24
D poc-D-promisehandler-catchCallback.js pending promise + Runtime.awaitPromise, then deferred reject session->inspector() v8-inspector-session-impl.h:47 via catchCallback injected-script.cc:305 232 B V8InspectorSessionImpl, +24

Common structure of every PoC (two stock sessions in one context group): the victim session enables Runtime + Debugger + Runtime.setCustomObjectFormatterEnabled; the controller session, on Debugger.paused, calls the committed utils.disconnectSession(victimId) and then Debugger.resume(). The page installs globalThis.devtoolsFormatters whose header runs debugger; (this is what opens the nested pause loop in which the disconnect is dispatched).

Run the callsite B impact demo

Sandbox-violation signal (the dereference faults at the attacker-chosen pointer):

UBSAN_OPTIONS='print_stacktrace=0:halt_on_error=0:abort_on_error=0:handle_segv=0:handle_sigbus=0:handle_sigill=0' \
  ./out/fuzzbuild-sandbox/inspector-test --sandbox-testing \
  test/inspector/protocol-test.js \
  poc-B-impact-controlled-pointer.js

Expected stderr: ## V8 sandbox violation detected! (a read access — the vtable load). gdb capture of the controlled fault:

UBSAN_OPTIONS='...handle_segv=0...' \
  gdb -batch -x poc-B-impact-controlled-pointer.gdb \
  --args ./out/fuzzbuild-sandbox/inspector-test \
  test/inspector/protocol-test.js \
  poc-B-impact-controlled-pointer.js

gdb shows si_addr equal to the chosen pointer and the faulting instruction mov (%r15),%rcx with r15 = the chosen pointer. See poc-B-impact-controlled-pointer.log.

Problem Description

Summary

Heap-use-after-free in the V8 Inspector console/exception/promise reporting path. The reporting frames hold raw pointers to V8InspectorSessionImpl and its owned V8RuntimeAgentImpl across an object-preview callout that re-enters page JS (devtoolsFormatters[*].header). If the session is disconnected while that JS is on the stack, ~V8InspectorSessionImpl runs inline and frees the objects; the reporting frame then dereferences the stale pointer. The freed objects are on the renderer C++ heap, outside the V8 sandbox cage. Four callsites reproduced under ASan at HEAD f1d2db6bb88 (V8 15.1.0); logs attached.

Attacker model

A debugger client (a chrome.debugger-permission extension, or any CDP / DevTools client) attaches a session, enables custom formatters (Runtime.setCustomObjectFormatterEnabled(true)), and disconnects (chrome.debugger.detach / session close) at the moment the inspected page emits a console.log / uncaught throw / settled promise carrying an object whose formatter header pauses execution. No prior memory primitive assumed.

Mechanism

The only session pin (KeepSessionAliveScope, v8-inspector-session-impl.cc:362) is on the dispatchProtocolMessage stack; the console/exception/promise-reporting stacks have none. So:

  1. The page installs globalThis.devtoolsFormatters whose header runs debugger;.
  2. Reporting a value whose preview fires that formatter hits debugger;, which enters a nested message loop on pause (handleProgramBreak -> runMessageLoopOnPause).
  3. While paused, the debugger client disconnects the session (utils.disconnectSession in the inspector-test harness); it is dispatched inside the nested loop, so DevToolsSession::Disconnect -> ~V8InspectorSessionImpl (:161) runs synchronously on the suspended reporting stack. That destroys unique_ptr<V8RuntimeAgentImpl> (144 B; holds m_frontend.frontend_channel_ at +24) and frees the 232 B session.
  4. The formatter returns; the reporting frame dereferences the freed pointer.

Prior fixes cover only the dispatchProtocolMessage stack, not these paths.

Reproduced callsites (ASan, unmodified build)

All free via utils.disconnectSession -> InspectorIsolateData::DisconnectSession (inspector-test.cc:442) -> ~V8InspectorSessionImpl.

  • A V8ConsoleMessage::wrapArguments (v8-console-message.cc:302). console.log(a,b): iter-0's wrapObject runs the formatter and frees the session; iter-1 derefs it at findInjectedScript (v8-inspector-session-impl.cc:228).
  • B reportToFrontend -> frontend->consoleAPICalled (v8-console-message.cc:404). Single-arg console.log({...}); reads frontend_channel_ from the freed V8RuntimeAgentImpl and virtual-dispatches SendProtocolNotification through it. See Impact.
  • C reportToFrontend kException -> frontend->exceptionThrown (:363). Uncaught throw {...}; wrapException runs the formatter, frees the session, then line 363 derefs the freed agent.
  • D InjectedScript::ProtocolPromiseHandler::catchCallback (injected-script.cc:305). A pending promise given to Runtime.awaitPromise then rejected from a later task runs catchCallback unpinned; its wrapObject preview frees the session, then line 305 reads session->inspector().

PoCs: poc-{A,B,C,D}-*.{js,log}.

Impact (callsite B)

Allocator-independent: the UAF reads frontend_channel_ from the freed object and immediately uses it as the receiver of a virtual call (SendProtocolNotification) — a code-pointer-bearing UAF, not a data read. Supplementary (glibc-configured build): the freed 144 B slot can be reclaimed from page JS (via inspector.scheduleWithAsyncStack, a same-size std::vector<uint16_t>) so frontend_channel_ becomes attacker-chosen; the vtable load then faults at exactly the chosen out-of-sandbox address, and varying it moves the fault bit-for-bit. Evidence: poc-B-impact-controlled-pointer.{js,gdb,log}.

Hardening notes (not reproduced)

  • E V8RuntimeAgentImpl::addBinding (~:1001): the post-Set recheck validates the context but not the session. Not reachable on stock V8 (the setter fires only on a default context, which runs pinned; contextCreated uses a pristine realm).
  • F getProperties -> InjectedScript (~:624): missing session recheck, but reached only via the pinned CDP dispatcher.

Suggested fix

A/B/C: capture a weak_ptr<V8InspectorSessionImpl> at reporting-function entry and bail before each post-callout deref if expired. D: re-fetch via sessionById(m_sessionId) after the wrapObject at injected-script.cc:298. Blanket: extend KeepSessionAliveScope from dispatchProtocolMessage to the console/exception delivery and async/promise-reaction entry points.

Summary

V8 Inspector: use-after-free in console/exception/promise reporting on session disconnect

Custom Questions

Type of crash:

tab

Reporter credit:

ywatanabee

Additional Data

Category: Security
Chrome Channel: Not sure
Regression: N/A \

The original report as published on the Chromium issue tracker, by yupyon.itome. 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 reporting functions hold raw pointers to the session and its runtime agent across a callout to page JavaScript that can disconnect the session, freeing those objects without invalidating the pointers.

Impact

The use-after-free can lead to a crash and, in some configurations, may allow an attacker to control a virtual call and potentially execute code outside the V8 sandbox.

What the attacker needed

Debugger client with permission; victim page with custom formatter; timing of disconnect during pause

The fix

The suggested fix is to use weak pointers or re-fetch the session after callouts, and to extend the session keep-alive scope to these reporting paths.

How it was found

  1. The page installs a custom formatter whose header runs a debugger statement.
  2. A console.log or similar triggers the formatter, pausing execution.
  3. While paused, the debugger client disconnects the session, freeing the session objects.
  4. The formatter returns and the reporting code dereferences the freed pointer.

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 bug where a program keeps using memory after it has been freed. Here, the inspector frees a session object while it is still being used to report console messages, leading to a crash or worse. An attacker who can attach a debugger and disconnect at the right moment could trigger this.

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 yupyon.itome

View all

1 more disclosed report, 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.