Use after free in Cast Streaming (CVE-2026-10888)
A race condition during session renegotiation in Cast Streaming can leave a deferred callback holding pointers to destroyed receiver objects. An attacker on the local network could trigger a use-after-free in the browser process, potentially leading to remote code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 41 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 race condition during session renegotiation in CastStreamingSession can lead to a Use-After-Free in the browser process. A pending async flush defers session initialization, capturing openscreen::cast::Receiver pointers in a callback that is not cleared when those receivers are subsequently destroyed by a rapid third renegotiation. This leads to a virtual call on freed memory.
Affected files:
components/cast_streaming/browser/cast_streaming_session.cccomponents/cast_streaming/browser/cast_streaming_session.hcomponents/cast_streaming/browser/frame/stream_consumer.cccomponents/cast_streaming/browser/common/streaming_initialization_info.h
Estimated timestamp from git blame: 2023-02-02
Overview
A potential Use-After-Free (UAF) vulnerability exists in the CastStreamingSession component within the browser process. The issue stems from the deferred execution of session start logic when a renderer-side flush is pending, combined with a failure to invalidate this deferred state when session receivers are destroyed during a rapid renegotiation.
Root Cause
When a Cast Streaming remoting session is negotiated, openscreen::cast::ReceiverSession creates Receiver objects for audio and video streams.
If a session renegotiation occurs (e.g., a new OFFER message arrives), openscreen tears down the old receivers. It calls CastStreamingSession::ReceiverSessionClient::OnReceiversDestroying, which initiates an asynchronous Mojo Flush() to the renderer and sets is_flush_pending_ = true.
If initialization configuration for the new session arrives before the Flush() completes, StartStreamingSession is called. Because is_flush_pending_ is true, it defers execution by storing a StreamingInitializationInfo struct inside a callback (start_session_cb_). Crucially, this struct holds raw_ptrs to the current Receiver objects.
If the attacker initiates a third session renegotiation before the original Flush() completes, openscreen again tears down the current receivers. OnReceiversDestroying is called again, but it fails to clear or invalidate start_session_cb_. openscreen then deletes the Receiver objects.
When the asynchronous Flush() finally completes, OnFlushComplete() executes the stale start_session_cb_. This resumes StartStreamingSession, passing the dangling Receiver pointers to the StreamConsumer constructor, which immediately performs a virtual call (receiver_->SetConsumer(this)) on the freed object.
Potential Exploitation Steps
Note: These are suggested steps based on static analysis; a working proof of concept has not been executed.
An attacker on the local network can trigger this by pipelining Cast-channel messages:
- Transmit an initial remoting OFFER (#1) to establish Session 1.
- Transmit a second remoting OFFER (#2). This destroys Session 1, triggering the async
Flush(), and creates Session 2 receivers. - Immediately transmit RPC initialization calls for Session 2. This populates the configs and triggers
StartStreamingSession, which defers execution intostart_session_cb_(capturing Session 2's receiver pointers) because the flush is pending. - Immediately transmit a third remoting OFFER (#3). This destroys Session 2's receivers.
start_session_cb_is not cleared. - Wait for the asynchronous
Flush()to complete.OnFlushCompleterunsstart_session_cb_, resulting in the UAF and vtable hijack inStreamConsumer::StreamConsumer.
Impact
This vulnerability occurs in the highly privileged Browser process. While the affected pointers are wrapped in raw_ptr, BackupRefPtr (BRP) is currently disabled by default on CastOS (!is_castos). Therefore, the raw_ptr wrapper provides no protection via partitioning or quarantining, making the UAF potentially exploitable for arbitrary Remote Code Execution.
Suggested Fix
In CastStreamingSession::ReceiverSessionClient::OnReceiversDestroying, explicitly clear the deferred callback when the receivers are being destroyed. For example:
if (start_session_cb_) {
start_session_cb_.Reset();
}
Evaluated with Chrome root at commit: 3acbde3302da0cb19488c22c0eb007c791207b4b
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
The deferred callback `start_session_cb_` is not cleared when receivers are destroyed during a rapid renegotiation, leaving dangling pointers.
Impact
The use-after-free occurs in the highly privileged browser process and, with BackupRefPtr disabled on CastOS, could potentially be exploited for arbitrary remote code execution.
What the attacker needed
Attacker on the local network; ability to send Cast-channel messages
The fix
The deferred callback should be explicitly cleared when receivers are being destroyed.
How it was found
- Transmit an initial remoting OFFER to establish Session 1.
- Transmit a second remoting OFFER, destroying Session 1 and triggering an async Flush while creating Session 2 receivers.
- Immediately transmit RPC initialization calls for Session 2, causing StartStreamingSession to defer execution into start_session_cb_ with Session 2's receiver pointers.
- Immediately transmit a third remoting OFFER, destroying Session 2's receivers without clearing start_session_cb_.
- Wait for the asynchronous Flush to complete, causing OnFlushComplete to run start_session_cb_ and trigger the use-after-free.
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.
When a streaming session is renegotiated, the code sometimes waits for a flush before starting the new session. If a third renegotiation happens quickly, the old session objects are destroyed but a saved callback still points to them. When the flush finishes, the callback uses the freed memory, which can crash or be exploited.
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.