VULNERABILITY in WebRTC (CVE-2026-11053)
A race condition in WebRTC stats collection can cause a cppgc::Persistent handle to be destroyed on the signaling thread when the main thread's task runner shuts down, corrupting the cppgc freelist on weakly ordered architectures like ARM. An attacker could potentially exploit this to achieve arbitrary memory writes and Remote Code Execution.
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 without the security team.
Overview: A race condition in WebRTC stats collection allows a cppgc::Persistent handle to be improperly destroyed on the signaling thread if the main thread's task runner shuts down. This non-atomic destruction corrupts the cppgc freelist on weakly ordered architectures like ARM. An attacker could potentially exploit this to achieve arbitrary memory writes and Remote Code Execution.
Affected files:
third_party/blink/renderer/platform/peerconnection/rtc_stats.ccthird_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.ccthird_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc
Estimated timestamp from git blame: 2025-08-26
Summary
A potential cross-thread destruction vulnerability exists in Blink's WebRTC implementation. When RTCPeerConnection.getStats() is called, a cppgc::Persistent handle is created and passed to the WebRTC signaling thread via a callback. If the main thread's task runner is shut down (e.g., by iframe detachment) before the operation completes, the callback fails to post back to the main thread and is destroyed synchronously on the signaling thread. This violates cppgc thread-safety guarantees and can corrupt the PersistentRegion freelist, potentially leading to Remote Code Execution (RCE).
Technical Details
- Handle Creation:
RTCPeerConnection::getStatscreates aScriptPromiseResolverand binds it into a callback usingWrapPersistent(resolver). This allocates aPersistentNodeon the main thread'sPersistentRegion. - Task Posting: This callback is sent to the WebRTC signaling thread inside an
RTCStatsCollectorCallbackImplwrapper. - Task Runner Shutdown: If the owning iframe is detached, its
ExecutionContextis destroyed, shutting down the frame's task queues. - Cross-Thread Destruction: When the signaling thread finishes gathering stats, it calls
PostCrossThreadTaskto return the result. Because the task runner is shut down,PostTaskreturnsfalse. The task payload, including thePersistenthandle, is synchronously destroyed on the signaling thread. - Freelist Corruption:
PersistentNode::FreeNodeexecutes on the signaling thread. In release builds, API checks are disabled, bypassing the thread-creationDCHECK.FreeNodeupdatesfree_list_head_and overwrites the node's internalunion { void* owner_; PersistentNode* next_; }.
On weakly-ordered CPU architectures (like ARM), concurrent Persistent allocations on the main thread can observe this update out-of-order. The main thread may read the new free_list_head_ but read the stale owner_ pointer (which points into the PartitionAlloc heap) instead of the new next_ pointer. This memory race results in the main thread's cppgc freelist pointing into arbitrary PartitionAlloc memory.
Potential Exploitation Steps
Note: These are suggested steps based on static analysis; our tooling does not currently have the capability to execute code to provide a working proof-of-concept.
- Setup: An attacker creates an
iframeand initializes anRTCPeerConnection. - Trigger Stats: The attacker calls
getStats()to begin asynchronous processing on the signaling thread. - Detach Frame: The attacker immediately removes the
iframefrom the DOM, invalidating its task runner. - Heap Spray: The attacker sprays the PartitionAlloc heap to control the memory surrounding the callback's bind state.
- Trigger Race: The attacker initiates concurrent
cppgcallocations from the main thread (e.g., via a surviving frame). If the main thread reads the torn freelist state, it will route the freelist into attacker-controlled PartitionAlloc memory. - Achieve RCE: Subsequent allocations from the corrupted freelist allow the attacker to control the
next_pointer (an arbitrary write primitive) or trigger a type confusion during the next Garbage Collection cycle whenTraceAsRootis called on the attacker-controlled payload.
Suggested Fix
Ensure that cross-thread tasks properly handle destruction when PostTask fails. The promise resolver should be bound using WrapCrossThreadPersistent instead of WrapPersistent when passed to WebRTCStatsReportCallbackResolver, as it is explicitly intended to travel across threads. Alternatively, RTCStatsCollectorCallbackImpl must be redesigned so that if posting back to the main thread fails, the callback payload is safely discarded on the main thread (or explicitly leaked) rather than destroyed on the signaling thread.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 callback holding a cppgc::Persistent handle is destroyed on the signaling thread when posting back to the main thread fails, violating cppgc thread-safety.
Impact
An attacker could potentially achieve arbitrary memory writes and Remote Code Execution, though the report notes this is based on static analysis without a working proof-of-concept.
What the attacker needed
Victim visits a malicious page; browser runs on ARM or weakly ordered CPU; release build without DCHECKs
The fix
The promise resolver should be bound using WrapCrossThreadPersistent instead of WrapPersistent, or the callback must be redesigned to safely discard or leak the payload on the main thread if posting back fails.
How it was found
- Create an iframe and initialise an RTCPeerConnection.
- Call getStats() to start asynchronous processing on the signaling thread.
- Immediately remove the iframe from the DOM to invalidate its task runner.
- Spray the PartitionAlloc heap to control memory around the callback's bind state.
- Trigger concurrent cppgc allocations from the main thread to race the freelist update.
- Use the corrupted freelist to gain an arbitrary write or type confusion during garbage collection.
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.
WebRTC lets browsers make video calls. When a page asks for call statistics, the browser creates a small reference to a promise object and sends it to a background thread. If the page is removed before the background thread finishes, that reference gets destroyed on the wrong thread, which can corrupt memory on some processors. This could let an attacker run their own code.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.