Use after free in WebRTC (CVE-2026-10948)
A use-after-free flaw in WebRTC's audio/video synchronisation logic leaves a dangling pointer in a video stream when an audio stream's sync group is changed. An attacker could potentially trigger this to achieve remote code execution in the renderer process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 44 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 without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential Use-After-Free (UAF) vulnerability exists in WebRTC's A/V synchronization logic. Changing an audio stream's sync group fails to clear the reference held by video streams in the old sync group. A subsequent stream destruction leaves a dangling raw pointer that is dereferenced by a periodic task, potentially leading to Remote Code Execution.
Affected files:
third_party/webrtc/call/call.ccthird_party/webrtc/video/rtp_streams_synchronizer2.ccthird_party/webrtc/video/rtp_streams_synchronizer2.hthird_party/webrtc/pc/channel.ccthird_party/webrtc/media/engine/webrtc_voice_engine.ccthird_party/webrtc/audio/audio_receive_stream.hthird_party/webrtc/video/video_receive_stream2.cc
Estimated timestamp from git blame: 2024-09-02
Root Cause
A potential Use-After-Free (UAF) vulnerability exists in the WebRTC implementation within Chrome's renderer process. The issue arises from how Call::OnUpdateSyncGroup and Call::DestroyAudioReceiveStream handle the transition of an AudioReceiveStreamImpl between synchronization groups.
When an audio stream's sync group is changed, Call::OnUpdateSyncGroup updates the stream's internal configuration and calls ConfigureSync for the new group only. ConfigureSync then iterates through all video streams, but only updates those whose sync_group() matches the provided argument.
// third_party/webrtc/call/call.cc
void Call::OnUpdateSyncGroup(webrtc::AudioReceiveStreamInterface& stream,
absl::string_view sync_group) {
webrtc::AudioReceiveStreamImpl& receive_stream =
static_cast<webrtc::AudioReceiveStreamImpl&>(stream);
receive_stream.SetSyncGroup(sync_group); // Updates config_.sync_group
ConfigureSync(sync_group); // Reconfigures NEW group only
}
If a VideoReceiveStream2 was previously synchronized with the audio stream in its old group, its internal reference (RtpStreamsSynchronizer::syncable_audio_) remains pointing to the audio stream because ConfigureSync is never called for the old group.
When the audio stream is later destroyed, Call::DestroyAudioReceiveStream again uses the updated sync_group() value, skipping the stale reference in the video stream once more. This leaves a dangling bare C++ pointer in RtpStreamsSynchronizer, which is not protected by MiraclePtr:
// third_party/webrtc/video/rtp_streams_synchronizer2.h
Syncable* syncable_audio_ RTC_GUARDED_BY(main_checker_) = nullptr;
This dangling pointer is dereferenced via a virtual call on the worker thread by a periodic 1 Hz task:
// third_party/webrtc/video/rtp_streams_synchronizer2.cc
std::optional<Syncable::Info> audio_info = syncable_audio_->GetInfo(); // Virtual call
Potential Exploit Scenario
An attacker can trigger this state by carefully maneuvering the stream through an unsignaled state to bypass standard teardown routines. These are suggested steps to trigger the vulnerability:
- The attacker establishes a WebRTC
PeerConnection. - The attacker sends a crafted SDP offer configuring an audio stream with sync group "group1" but omitting any signaled SSRCs (an unsignaled stream).
WebRtcVoiceReceiveChannel::AddRecvStreamcaches this configuration. - The attacker negotiates a signaled video stream associated with the same sync group "group1".
- The attacker sends an RTP audio packet with a new SSRC.
MaybeCreateDefaultReceiveStreamhandles the packet, uses the cached parameters to spawn anAudioReceiveStreamImpl, and syncs it with the video stream. - The attacker sends a new valid SDP offer containing the now-signaled audio stream with a new sync group ("group2"), alongside a dummy unsignaled audio stream. The dummy stream bypasses
ResetUnsignaledRecvStream()(which would otherwise destroy the old stream safely). - The stream is promoted.
Call::OnUpdateSyncGroupis called with "group2", leaving the video stream in "group1" with a stale pointer to the audio stream. - The attacker sends a final SDP offer removing the audio stream. The audio stream is deleted, but the video stream still holds the pointer.
- The attacker performs heap spraying in the renderer to reclaim the freed memory with a controlled vtable.
- The 1 Hz
repeating_task_inRtpStreamsSynchronizerexecutes a virtual function call on the attacker-controlled vtable, leading to Control Flow Hijacking and Remote Code Execution in the renderer process.
Suggested Fix
Modify Call::OnUpdateSyncGroup to clear the synchronization state of the old sync group before setting the new one. Call should either track the previous sync group and explicitly call ConfigureSync(old_sync_group), or it should iterate through all video_receive_streams_ and set syncable_audio_ to nullptr for any video stream that currently points to the audio stream being updated, regardless of its sync_group string.
Evaluated with Chrome root at commit: 7353d249d9cacf9c7218e1d7b8a39cf39c72d646
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, changing an audio stream's sync group only reconfigures the new group, so video streams in the old group keep a stale pointer to the audio stream, which is not cleared on destruction.
Impact
The dangling pointer could be dereferenced via a virtual call, potentially leading to control flow hijacking and remote code execution in the renderer process.
What the attacker needed
Attacker can establish a WebRTC PeerConnection; attacker can send crafted SDP offers; attacker can send RTP packets
The fix
The fix should modify Call::OnUpdateSyncGroup to clear the synchronization state of the old sync group before setting the new one, either by tracking the previous group or by iterating all video streams and nulling any pointer to the audio stream.
How it was found
- The attacker establishes a WebRTC PeerConnection.
- The attacker sends a crafted SDP offer configuring an audio stream with sync group "group1" but omitting any signaled SSRCs.
- The attacker negotiates a signaled video stream associated with the same sync group "group1".
- The attacker sends an RTP audio packet with a new SSRC, causing an audio receive stream to be created and synced with the video stream.
- The attacker sends a new SDP offer with the audio stream in a new sync group "group2" and a dummy unsignaled audio stream.
- The attacker sends a final SDP offer removing the audio stream, leaving the video stream with a dangling pointer.
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 happens when a program keeps a reference to memory it has already freed. Here, a video stream still points to an audio stream that has been deleted, and a timer later tries to use that stale pointer. If an attacker can control what replaces the freed memory, they might 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.