Use after free in V8 (CVE-2026-87625)
A re-entrancy flaw in V8's FutexEmulation allows the per-isolate singleton wait node to be added to the wait list twice when a debugger evaluates code on a frozen worker inside a nested event loop. This can corrupt the wait list and potentially lead to a use-after-free or heap out-of-bounds write in the renderer.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential re-entrancy vulnerability exists in V8's FutexEmulation where the per-isolate singleton FutexWaitListNode can be double-added to the wait list. This condition is reachable when a worker thread is frozen/paused and a debugger session issues a Runtime.evaluate command, which executes on the unpausable kInternalInspector queue inside a nested event loop. Re-entering Atomics.wait during this execution corrupts the doubly-linked list of wait nodes, potentially leading to a use-after-free or heap out-of-bounds write in the renderer process.
Affected files:
v8/src/execution/futex-emulation.ccthird_party/blink/renderer/core/inspector/devtools_session.ccthird_party/blink/renderer/core/workers/worker_thread.ccthird_party/blink/renderer/platform/scheduler/worker/worker_scheduler_impl.cc
Estimated timestamp from git blame: 2019-05-14
Root Cause Analysis
In V8, FutexEmulation::WaitSyncImpl utilizes a per-isolate singleton FutexWaitListNode (isolate->futex_wait_list_node()) to manage synchronous Atomics.wait operations. A potential re-entrancy issue in this design allows the same singleton node to be added to the global wait list multiple times, corrupting the intrusive doubly-linked list of waiter nodes.
The execution flow to trigger this condition is as follows:
- Unpausable Task Queue:
WorkerSchedulerImplmapsTaskType::kInternalInspectortounpausable_task_queue_(third_party/blink/renderer/platform/scheduler/worker/worker_scheduler_impl.cc:215). This queue is initialized without aQueueEnabledVoter(worker_scheduler_impl.cc:64) and is therefore never disabled byPauseImpl()when the worker thread is paused or frozen. - Direct IO Dispatch: When a
Runtime.evaluatecommand is sent viachrome.debuggerto a worker target, the browser routes it over the IO channel, and the renderer IO thread posts it directly to thekInternalInspectortask runner as a nestable task (third_party/blink/renderer/core/inspector/devtools_session.cc:118-128). - Interrupt during Wait: While a worker thread is blocked inside
Atomics.wait, a lifecycle freeze of the parent page triggers a V8 API interrupt (worker_thread.cc:916-918). This wakes the worker thread from its condition variable. InsideWaitSyncImpl, the thread clears theinterrupted_flag, unlocks the wait list mutex, and callsisolate->stack_guard()->HandleInterrupts()(v8/src/execution/futex-emulation.cc:466-467) with the singleton node still linked on the active wait list. - Nested Event Loop: The V8 interrupt handler invokes the Blink freeze callback, which pauses the scheduler and spins a nested event loop (
worker_thread.cc:960-964) usingPlatform::Current()->CreateNestedMessageLoopRunner()->Run(). This runner executes nestable tasks. - Re-entrant Execution: The nested event loop processes the pending nestable
Runtime.evaluatecommand, allowing arbitrary JavaScript execution. If this evaluation callsAtomics.waiton a different address, it re-entersWaitSyncImplwith the same singleton node. - List Corruption: In production (release) builds where
DCHECK_NULLassertions are compiled out, the inner wait overwritesnode->wait_location_and callsAddNodeon the already-linked singleton node. When the inner wait times out, it erases the new address entry, leaving the old address entry pointing to the singleton node. When the outer wait subsequently resumes and finishes, its call toRemoveNodeis ineffective becausenode->wait_location_was altered, leaving a stale pointer in the global wait registry. - Heap Exploitation: Interleaving
Atomics.waitAsyncoperations from a separate isolate can cause newly allocated and subsequently freed async waiter nodes to be linked to this stale pointer, resulting in a classic Use-After-Free (UAF) or wild memory write inside the sandboxed renderer process.
Potential Step-by-Step Reproduction Path
(Note: These are potential steps; our tooling has not executed this code to verify execution details.)
- Establish a Dedicated Worker and pass it a
SharedArrayBuffer(SAB). - Attach to the worker target using an extension with
debuggerpermissions. - Have the worker thread enter a sleep state by calling
Atomics.wait(new Int32Array(sab), 0, 0)on the first index. - Initiate a freeze transition of the worker's parent context, prompting V8 to request an API interrupt via the StackGuard.
- The worker thread wakes from its condition variable and enters a nested event loop inside V8's
HandleInterrupts()with the singleton waiter node still linked. - Via the attached debugger, execute the command
Runtime.evaluateon the worker target, passingAtomics.wait(new Int32Array(sab), 1, 0, 100)to trigger a wait on the second index. - The nested run loop processes this task, re-entering
WaitSyncImpland double-adding the singleton node. - Allow the inner wait to time out (100ms) and the parent context to resume from freeze. The outer wait resumes and terminates, leaving a stale pointer to the singleton node on the first index's wait list.
- Issue an
Atomics.waitAsyncfrom a separate isolate on the first index to allocate and link an async node. When that async node is subsequently freed, walking or manipulating the wait list results in a potential Use-After-Free.
Suggested Fix
To remediate this issue, consider implementing one of the following changes:
- Introduce a re-entrancy check within
FutexEmulation::WaitSyncImplthat throws aRangeErrororTypeErrorif a synchronous wait is initiated while the isolate's singletonFutexWaitListNodeis already in awaiting_state. - Ensure that any DevTools-initiated script evaluations on frozen worker threads (via
Runtime.evaluate) are rejected or deferred if V8 is currently suspended inside an activeHandleInterrupts()frame originating from aWaitSyncImplstate.
Evaluated with Chrome root at commit: 84065d9121f6e48f67755f0ae963cc09617e5c85
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
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
Likely the per-isolate singleton FutexWaitListNode is not protected against re-entrant Atomics.wait calls, so it can be linked into the wait list more than once.
Impact
This could lead to a use-after-free or heap out-of-bounds write inside the sandboxed renderer process, though the report notes the steps are potential and have not been executed.
What the attacker needed
A debugger extension with permissions; a dedicated worker with a SharedArrayBuffer; ability to freeze the worker's parent context
The fix
The issue should be fixed by adding a re-entrancy check in WaitSyncImpl that rejects a synchronous wait when the singleton node is already waiting, or by deferring debugger evaluations on frozen workers during an active interrupt.
How it was found
- Create a dedicated worker and give it a SharedArrayBuffer.
- Attach a debugger to the worker target.
- Make the worker call Atomics.wait on the first index of the buffer.
- Freeze the worker's parent context to trigger an interrupt.
- Use the debugger to run Runtime.evaluate on the worker, calling Atomics.wait on the second index.
- Let the inner wait time out and the parent resume, leaving a stale pointer in the wait list.
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.
When a worker thread is paused, a debugger can still run code on it. That code can call a waiting function again while the first wait is still active, confusing the list of waiting threads. The confusion could let an attacker corrupt memory in the browser's renderer process.
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.