Use after free in WebRTC (CVE-2026-10939)
A use-after-free exists in WebRtcAudioRenderer because it keeps a raw pointer to WebRtcAudioDeviceImpl that is not cleared when the device is destroyed asynchronously. An attacker could trigger a race condition where the audio thread accesses freed memory, leading to a crash or potentially remote code execution on Android.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 47 days
Flapjack, 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 Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.
Overview: A potential Use-After-Free exists in WebRtcAudioRenderer because it retains a dangling raw pointer to its source (WebRtcAudioDeviceImpl) after the source is destroyed. In cross-frame scenarios, the source can be destroyed asynchronously on the signaling thread while the renderer is kept alive by another frame, leading to a race condition where the audio thread accesses freed memory.
Affected files:
third_party/blink/renderer/modules/webrtc/webrtc_audio_renderer.ccthird_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.cc
Estimated timestamp from git blame: 2026-01-09
Summary
A potential Use-After-Free (UAF) vulnerability has been identified in the WebRTC audio rendering pipeline in Blink. The WebRtcAudioRenderer class maintains a raw_ptr to a WebRtcAudioRendererSource (which is implemented by WebRtcAudioDeviceImpl). When the WebRtcAudioDeviceImpl is destroyed asynchronously on the signaling thread, it fails to safely nullify this pointer in the renderer. In cross-frame scenarios, the WebRtcAudioRenderer can outlive the WebRtcAudioDeviceImpl, leaving the high-priority audio thread to access freed memory during its callback cycle.
Note: The following sequences are potential steps derived from deep code analysis. Our tooling agent does not yet have the ability to execute code to produce a working proof of concept.
Technical Details & Lifetime Mismatch
In third_party/blink/renderer/modules/webrtc/webrtc_audio_renderer.h, WebRtcAudioRenderer holds a reference to its source:
raw_ptr<WebRtcAudioRendererSource> source_;
To avoid a reference cycle, WebRtcAudioDeviceImpl holds a scoped_refptr to the renderer, while the renderer holds a raw_ptr back to the device.
When a MediaStreamTrack is created in Frame A and passed to an <audio> element in Frame B, Frame B's WebMediaPlayerMS creates a proxy that holds a scoped_refptr to the WebRtcAudioRenderer. The renderer points to Frame A's WebRtcAudioDeviceImpl.
Potential Trigger Sequence
An attacker could potentially trigger this vulnerability using the following steps:
- Setup: Create a webpage with two iframes (Frame A and Frame B). In Frame A, establish an
RTCPeerConnectionand receive a remote audioMediaStreamTrack. - Transfer: Pass this
MediaStreamfrom Frame A to Frame B viapostMessageand play it in an<audio>element in Frame B. - Destruction: Remove Frame A from the DOM. This causes Frame A's
ExecutionContextto be destroyed, and itsPeerConnectionDependencyFactoryis marked for Garbage Collection. - Pre-Finalizer Execution: During GC sweeping on the main thread,
CleanupPeerConnectionFactoryruns. It posts a task to the WebRTC Signaling Thread to release thePeerConnectionFactory. - Asynchronous Teardown: Concurrently, closing the
RTCPeerConnectionposts a task to the Signaling Thread. The track state changes to "Ended", which posts an asynchronous notification back to the Main Thread so Frame B can stop playback. - The Race Condition: On the Signaling Thread, the
PeerConnectionFactoryand itsConnectionContextare destroyed. This drops the last references to theWebRtcAudioDeviceImpl. - Dangling Pointer:
WebRtcAudioDeviceImpl::Terminate()is called, settinginitialized_ = false, but failing to clear the renderer'ssource_pointer. The object is then destroyed, but theWebRtcAudioRenderersurvives because Frame B'sWebMediaPlayerMSstill holds ascoped_refptrto it (as the Main Thread hasn't processed the track-ended event yet). - UAF Execution: The hardware audio thread fires its 10ms callback, executing
WebRtcAudioRenderer::Render(), which callssource_->RenderData(...). Sincesource_is now a danglingraw_ptr, a Use-After-Free occurs.
Impact
On desktop platforms where MiraclePtr (BackupRefPtr) is enabled, this vulnerability typically results in a deterministic crash (Denial of Service). However, MiraclePtr is currently disabled by default in Renderer processes on non-desktop Android platforms due to performance constraints. On these platforms, the memory is immediately returned to the allocator. Because the UAF triggers a virtual method call (RenderData), an attacker who reclaims the memory with a fake vtable from Frame B's JavaScript could potentially achieve Remote Code Execution (RCE) within the renderer sandbox.
Suggested Fix
WebRtcAudioDeviceImpl should explicitly clear the renderer's source_ pointer before it is destroyed. Since Terminate() and the ADM's destructor run on the Signaling Thread, while the renderer's source_ pointer is protected by WebRtcAudioRenderer::lock_, the ADM could acquire the renderer's lock and set source_ = nullptr during termination. Alternatively, the architecture could be refactored to use thread-safe weak pointers (base::WeakPtr if bound to the correct sequence) or explicit cross-thread teardown signals to guarantee the renderer stops pulling data before the ADM is freed.
Evaluated with Chrome root at commit: c0eb5541aebfa4ea08806eaf6e94bcc69f87ab2f
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, WebRtcAudioDeviceImpl does not clear the renderer's raw pointer to itself when it is destroyed, so the renderer later accesses freed memory.
Impact
On desktop with MiraclePtr enabled, this typically causes a deterministic crash (denial of service); on non-desktop Android where MiraclePtr is disabled, an attacker could potentially achieve remote code execution within the renderer sandbox.
What the attacker needed
Victim visits attacker's webpage; two iframes with cross-frame media transfer; non-desktop Android for RCE
The fix
WebRtcAudioDeviceImpl should explicitly clear the renderer's source_ pointer before destruction, for example by acquiring the renderer's lock and setting source_ = nullptr during termination, or by refactoring to use thread-safe weak pointers.
How it was found
- Create a webpage with two iframes; in Frame A, establish an RTCPeerConnection and receive a remote audio MediaStreamTrack.
- Pass the MediaStream from Frame A to Frame B via postMessage and play it in an audio element in Frame B.
- Remove Frame A from the DOM, causing its ExecutionContext to be destroyed and PeerConnectionDependencyFactory marked for garbage collection.
- During GC sweeping, CleanupPeerConnectionFactory posts a task to the WebRTC Signaling Thread to release the PeerConnectionFactory.
- Concurrently, closing the RTCPeerConnection posts a task to the Signaling Thread; the track state changes to 'Ended', posting an asynchronous notification back to the Main Thread.
- On the Signaling Thread, the PeerConnectionFactory and ConnectionContext are destroyed, dropping the last references to WebRtcAudioDeviceImpl; Terminate() is called but fails to clear the renderer's source_ pointer, and the object is…
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, an audio component holds a pointer to another object that gets destroyed, and then the audio thread tries to use that pointer, which can crash the browser or let an attacker run their own code.
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.