Object lifecycle issue in WebRTC (CVE-2026-17884)
A missing assignment in WebRtcAudioDeviceImpl::Terminate() leaves a strong reference to the audio renderer, so the renderer is later destroyed on the WebRTC signaling thread instead of the main thread. This wrong-thread destruction of Oilpan handles corrupts the heap free list and could likely be leveraged for remote code execution in the renderer process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 47 days
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 logic error in WebRtcAudioDeviceImpl::Terminate() fails to clear its strong reference to WebRtcAudioRenderer. This bypasses intended cleanup paths, causing the renderer to be destroyed on the WebRTC signaling thread, which corrupts Oilpan heap structures and potentially leads to RCE.
Affected files:
third_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.ccthird_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.hthird_party/blink/renderer/modules/webrtc/webrtc_audio_renderer.ccthird_party/blink/renderer/modules/webrtc/webrtc_audio_renderer.h
Estimated timestamp from git blame: Unknown (Google3 checkout)
Root Cause
In third_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.cc, the Terminate() method executes on the WebRTC signaling thread to safely disconnect the audio renderer. It copies the renderer_ member variable to a local renderer_to_disconnect variable for a safe main-thread bounce using ReleaseSoon().
However, the implementation fails to clear the renderer_ member variable itself (missing renderer_ = nullptr;).
int32_t WebRtcAudioDeviceImpl::Terminate() {
// ...
scoped_refptr<blink::WebRtcAudioRenderer> renderer_to_disconnect;
{
base::AutoLock auto_lock(lock_);
renderer_to_disconnect = renderer_;
// MISSING: renderer_ = nullptr;
capturers_.clear();
}
if (renderer_to_disconnect) {
renderer_to_disconnect->DisconnectSource();
// ... ReleaseSoon ...
}
}
The Flawed State Machine
Terminate() calls renderer_to_disconnect->DisconnectSource(), which sets the renderer's internal source_ pointer to nullptr.
Later, when the audio player is stopped on the main thread (e.g., due to iframe detachment), WebRtcAudioRenderer::Stop() is invoked. Stop() is designed to deregister the renderer from the device by calling source_->RemoveAudioRenderer(this). However, because source_ was prematurely set to nullptr during Terminate(), this check fails, and RemoveAudioRenderer() is skipped.
Consequently, the intended mechanism to clear WebRtcAudioDeviceImpl::renderer_ is bypassed, leaving the Audio Device Module (ADM) holding a dangling, strong scoped_refptr to the renderer.
Wrong-Thread Destruction
During garbage collection, PeerConnectionDependencyFactory posts a task to destroy the native webrtc::PeerConnectionFactory on the WebRTC signaling thread. The destruction of this native factory drops the final reference to WebRtcAudioDeviceImpl.
As WebRtcAudioDeviceImpl is destroyed on the signaling thread, its member variables are destroyed, dropping the final, uncleared reference to the WebRtcAudioRenderer. This forces ~WebRtcAudioRenderer() to execute synchronously on the signaling thread.
Impact
WebRtcAudioRenderer contains Blink Oilpan garbage collection handles, specifically WeakPersistent<LocalFrame> source_frame_; and Persistent<MediaStreamDescriptor> media_stream_descriptor_;.
Oilpan Persistent handles have strict thread affinity. When destroyed, they call PersistentRegion::FreeNode(). Executing this on the signaling thread instead of the creation thread bypasses debug checks and modifies the free_list_head_ of the main thread's Oilpan heap without locking. This concurrent modification creates a data race that reliably corrupts the heap free list, yielding a primitive that can likely be leveraged for Remote Code Execution (RCE) in the sandboxed renderer process.
Potential Trigger Steps
Note: These are suggested steps based on code analysis; we do not currently have a working proof of concept.
An attacker could potentially trigger this issue via the following sequence:
- Establish a WebRTC connection and receive an audio track.
- Assign the
MediaStreamto an<audio>tag inside aniframe. - Close the WebRTC connection (
pc.close()). This invokesTerminate()on the signaling thread, nulling the renderer'ssource_but leaving the ADM'srenderer_populated. - Remove the
iframefrom the DOM. This invokesStop()on the main thread, which drops legitimate references but skipsRemoveAudioRenderer. - Wait for garbage collection. The ADM is eventually destroyed on the signaling thread, triggering the wrong-thread destruction of the renderer and corrupting the Oilpan heap.
Suggested Fix
Modify WebRtcAudioDeviceImpl::Terminate() to ensure the renderer_ member is cleared:
{
base::AutoLock auto_lock(lock_);
renderer_to_disconnect = std::move(renderer_); // Or explicitly: renderer_ = nullptr;
capturers_.clear();
}
Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb
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 Terminate() method copies the renderer_ member to a local variable but never clears the member itself, so a strong reference survives and the renderer is destroyed on the wrong thread.
Impact
The wrong-thread destruction of Oilpan handles creates a data race that reliably corrupts the heap free list, yielding a primitive that can likely be leveraged for remote code execution in the sandboxed renderer process.
What the attacker needed
Attacker controls a WebRTC audio stream; victim loads attacker page with iframe; no working proof of concept yet
The fix
The Terminate() method should be modified to clear the renderer_ member, for example by moving it into the local variable or explicitly setting it to null.
How it was found
- Establish a WebRTC connection and receive an audio track.
- Assign the MediaStream to an audio tag inside an iframe.
- Close the WebRTC connection, which invokes Terminate() on the signaling thread.
- Remove the iframe from the DOM, which invokes Stop() on the main thread and skips RemoveAudioRenderer.
- Wait for garbage collection so the ADM is destroyed on the signaling thread, triggering wrong-thread destruction of the renderer.
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 part of the browser that handles audio for video calls keeps a reference to an audio object even after it should have let go. That object is later destroyed on the wrong thread, which can corrupt the browser's memory management and potentially let an attacker run code. The report is based on code analysis and has no working proof of concept yet.
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.