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

Use after free in Chromoting (CVE-2026-7347)

A use-after-free exists in the ChromeOS Boca remoting client because the video renderer adapter unregisters from the wrong track after SDP renegotiation changes the stream's tracks. An attacker could send crafted SDP and RTP to trigger a virtual call on freed memory, potentially achieving remote code execution in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 18 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.

Overview: A potential Use-After-Free (UAF) exists in the ChromeOS Boca remoting client. The WebrtcVideoRendererAdapter registers as a video sink on its stream's first track but re-queries the stream's track list during destruction, failing to unregister correctly if the tracks were changed via SDP renegotiation. This leaves an unprotected dangling pointer in the original WebRTC video track, which can be triggered by incoming video frames.

Affected files:

  • remoting/protocol/webrtc_video_renderer_adapter.cc
  • remoting/protocol/webrtc_connection_to_host.cc
  • remoting/protocol/webrtc_video_renderer_adapter.h

Estimated timestamp from git blame: 2025-04-14

Summary

A potential Use-After-Free (UAF) vulnerability exists in remoting::protocol::WebrtcVideoRendererAdapter. The class registers itself as a video sink on the first track of a WebRTC MediaStream. However, because MediaStream objects are mutable in-place via SDP renegotiation, the tracks can change before the adapter is destroyed. During destruction, the adapter re-queries the stream for its first track, meaning it may unregister from the new track rather than the original track it subscribed to. This leaves a dangling pointer in the original track, which results in a virtual method call on freed memory when a new video frame is received.

Technical Details

When a stream is added, WebrtcConnectionToHost creates a WebrtcVideoRendererAdapter and calls its SetMediaStream method. This method registers the adapter as a sink on the first video track of the stream:

C++
void WebrtcVideoRendererAdapter::SetMediaStream(
    webrtc::scoped_refptr<webrtc::MediaStreamInterface> media_stream) {
  media_stream_ = std::move(media_stream);
  webrtc::VideoTrackVector video_tracks = media_stream_->GetVideoTracks();
  // ...
  video_tracks[0]->AddOrUpdateSink(this, webrtc::VideoSinkWants());
}

The destructor later attempts to unregister the sink by again querying the first track of media_stream_:

C++
WebrtcVideoRendererAdapter::~WebrtcVideoRendererAdapter() {
  // ...
  webrtc::VideoTrackVector video_tracks = media_stream_->GetVideoTracks();
  DCHECK(!video_tracks.empty());
  video_tracks[0]->RemoveSink(this);
}

If a remote host sends a new SDP offer that changes the tracks associated with the MediaStream (e.g., using the a=msid attribute to replace track T0 with track T1), WebRTC mutates the MediaStream object in-place. OnAddStream is not fired again since the stream ID remains the same, so WebrtcVideoRendererAdapter is never notified. When the adapter is eventually destroyed, media_stream_->GetVideoTracks()[0] returns T1. The destructor calls RemoveSink on T1, leaving the adapter still registered as a sink on T0.

The VideoBroadcaster in third_party/webrtc/media/base/video_source_base.h stores these sinks inside a SinkPair struct using a standard C++ raw pointer (VideoSinkInterface<VideoFrame>* sink;). Because it is not a base::raw_ptr, PartitionAlloc's BackupRefPtr (MiraclePtr) mitigation does not protect it. When T0 receives a frame, it iterates its sinks and invokes sink->OnFrame(frame), triggering a virtual call on freed memory.

Potential Exploitation Steps

Note: These are suggested steps for an attacker, as our tooling agent does not currently have the ability to run dynamic code to provide a working proof-of-concept.

  1. Establish a WebRTC connection to the victim (e.g., via the ChromeOS Boca Spotlight feature).
  2. Send an SDP offer defining a MediaStream (Stream S) with a single video track (T0). The victim creates a WebrtcVideoRendererAdapter and registers it on T0.
  3. Send an SDP renegotiation offer that modifies Stream S so it no longer contains T0 at index 0 (e.g., replace it with a new track T1). WebRTC mutates Stream S in-place.
  4. Trigger the destruction of the adapter. This can be done by opening an SCTP data channel with a new video label (e.g., video_stats:S2). This causes WebrtcConnectionToHost::GetOrCreateVideoAdapter to overwrite the existing unique_ptr<WebrtcVideoRendererAdapter>, immediately destroying the old adapter.
  5. The old adapter's destructor runs, queries Stream S, finds track T1, and calls RemoveSink on T1. The original track T0 still holds a dangling pointer to the freed adapter.
  6. Send RTP video frames for track T0. The client decodes the frame and calls the virtual OnFrame method on the dangling pointer, granting control over the execution flow.

Impact

In ChromeOS, the Remoting client used by the Boca Spotlight feature runs on a dedicated IO thread within the browser process (Boca Spotlight IO). Exploitation of this UAF provides a primitive for Remote Code Execution (RCE) directly within the unsandboxed browser process.

Suggested Fix

Instead of dynamically querying the MediaStream for its tracks during destruction, the WebrtcVideoRendererAdapter should explicitly store a scoped_refptr<webrtc::VideoTrackInterface> (or safely handle tracking) to the exact track it successfully registered with in SetMediaStream. The destructor should then call RemoveSink on that specific track instance.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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

The destructor re-queries the stream for its first track instead of storing the exact track it registered with, so after SDP renegotiation it unregisters from the wrong track and leaves a dangling pointer.

Impact

Exploitation could provide a primitive for remote code execution directly within the unsandboxed browser process, though the report notes these are suggested steps and no working proof-of-concept was run.

What the attacker needed

Ability to establish a WebRTC connection; ability to send crafted SDP offers; ability to send RTP video frames; ChromeOS Boca Spotlight feature enabled

The fix

The adapter should store a reference to the exact track it registered with and unregister from that specific track in the destructor.

How it was found

  1. Establish a WebRTC connection to the victim.
  2. Send an SDP offer defining a MediaStream with a single video track, causing the victim to create an adapter and register it on that track.
  3. Send an SDP renegotiation offer that replaces the track at index 0 with a new track, mutating the stream in-place.
  4. Trigger destruction of the adapter by opening an SCTP data channel with a new video label.
  5. The old adapter's destructor unregisters from the new track, leaving a dangling pointer in the original track.
  6. Send RTP video frames for the original track to trigger a virtual call on the freed adapter.

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 pointer to memory it has already freed and later uses it. Here, the video component remembers the wrong track after the stream is changed, so it still points to the old track and calls a function through that stale pointer when a new frame arrives. This can let an attacker control what code runs.

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.