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

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.cc
  • third_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:

C++
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:

  1. Setup: Create a webpage with two iframes (Frame A and Frame B). In Frame A, establish an RTCPeerConnection and receive a remote audio MediaStreamTrack.
  2. Transfer: Pass this MediaStream from Frame A to Frame B via postMessage and play it in an <audio> element in Frame B.
  3. Destruction: Remove Frame A from the DOM. This causes Frame A's ExecutionContext to be destroyed, and its PeerConnectionDependencyFactory is marked for Garbage Collection.
  4. Pre-Finalizer Execution: During GC sweeping on the main thread, CleanupPeerConnectionFactory runs. It posts a task to the WebRTC Signaling Thread to release the PeerConnectionFactory.
  5. Asynchronous Teardown: Concurrently, closing the RTCPeerConnection posts 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.
  6. The Race Condition: On the Signaling Thread, the PeerConnectionFactory and its ConnectionContext are destroyed. This drops the last references to the WebRtcAudioDeviceImpl.
  7. Dangling Pointer: WebRtcAudioDeviceImpl::Terminate() is called, setting initialized_ = false, but failing to clear the renderer's source_ pointer. The object is then destroyed, but the WebRtcAudioRenderer survives because Frame B's WebMediaPlayerMS still holds a scoped_refptr to it (as the Main Thread hasn't processed the track-ended event yet).
  8. UAF Execution: The hardware audio thread fires its 10ms callback, executing WebRtcAudioRenderer::Render(), which calls source_->RenderData(...). Since source_ is now a dangling raw_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.

The original report as published on the Chromium issue tracker. 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

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

  1. Create a webpage with two iframes; in Frame A, establish an RTCPeerConnection and receive a remote audio MediaStreamTrack.
  2. Pass the MediaStream from Frame A to Frame B via postMessage and play it in an audio element in Frame B.
  3. Remove Frame A from the DOM, causing its ExecutionContext to be destroyed and PeerConnectionDependencyFactory marked for garbage collection.
  4. During GC sweeping, CleanupPeerConnectionFactory posts a task to the WebRTC Signaling Thread to release the PeerConnectionFactory.
  5. 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.
  6. 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.

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.