Use after free in Chromecast (CVE-2026-10884)
A compromised renderer can call the Cast renderer's Initialize method twice; if the second call fails, the underlying player is freed but a dangling pointer remains, allowing a later compositor frame to write attacker-controlled bounds to freed memory.
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 without the Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.
Overview: A compromised renderer can trigger a Use-After-Free in the Cast browser process by initializing a StarboardRenderer twice via its Mojo interface. If the second initialization fails, the underlying player is freed but a dangling pointer remains in GeometryChangeHandler, which can later be dereferenced by submitting a specific compositor frame.
Affected files:
chromecast/starboard/media/renderer/starboard_renderer.ccchromecast/starboard/media/renderer/geometry_change_handler.ccchromecast/starboard/media/renderer/geometry_change_handler.hchromecast/starboard/media/renderer/starboard_player_manager.ccmedia/mojo/services/mojo_renderer_service.ccchromecast/starboard/media/media/starboard_api_wrapper_base.cc
Estimated timestamp from git blame: 2025-10-06
Summary
A potential Use-After-Free (UAF) vulnerability exists in the Cast browser process on Starboard builds. The MojoRendererService uses a DCHECK to prevent re-initialization, which is compiled out in release builds. This allows a compromised renderer to call Initialize multiple times. If a subsequent initialization fails, StarboardRenderer destroys the existing StarboardPlayerManager (freeing the SbPlayer) but fails to clear the sb_player_ pointer in its GeometryChangeHandler. A subsequent geometry update via a VideoHoleDrawQuad will then write attacker-controlled bounds to the freed SbPlayer memory.
Vulnerability Details
-
MojoRendererService::Initialize(inmedia/mojo/services/mojo_renderer_service.cc) uses a debug-onlyDCHECK_EQ(state_, STATE_UNINITIALIZED)to ensure it is only called once. In release builds, a compromised renderer can call this method multiple times on the same remote. -
When
Initializeis called a second time, it eventually invokesStarboardRenderer::Initialize(inchromecast/starboard/media/renderer/starboard_renderer.cc). -
StarboardRenderer::Initializeattempts to create a newStarboardPlayerManagerby callingStarboardPlayerManager::Create(...). -
If the attacker provides an unsupported media configuration (e.g., using
AudioCodec::kAMR_NB),Createfails and returnsnullptr. -
The assignment
player_manager_ = StarboardPlayerManager::Create(...)evaluates tonullptr. Becauseplayer_manager_is astd::unique_ptr, this destroys the oldStarboardPlayerManagerfrom the first initialization, which in turn callsSbPlayerDestroyto free the underlying vendor-allocatedSbPlayer. -
Because
player_manager_is now null,StarboardRenderer::Initializereturns early with an error:C++ if (!player_manager_) { // Early return on failure media_task_runner_->PostTask(..., PIPELINE_ERROR_INITIALIZATION_FAILED); return; } -
Crucially, the early return skips the subsequent call to
geometry_change_handler_.SetSbPlayer(...). As a result, theGeometryChangeHandlerretains a danglingraw_ptr<void> sb_player_pointing to the freed memory. -
The attacker can then trigger
GeometryChangeHandler::OnVideoGeometryChangeby submitting a compositor frame from the renderer containing aVideoHoleDrawQuadwith the originaloverlay_plane_idand attacker-controlled bounds. -
OnVideoGeometryChangecallsSetPlayerBounds, which invokes the vendor Starboard APISbPlayerSetBoundswith the danglingsb_player_pointer and the attacker-controlled coordinates, resulting in a highly controllable Write-After-Free in the browser process.
Note: MiraclePtr (BackupRefPtr) does not mitigate this vulnerability because SbPlayer is allocated by an external vendor library, not PartitionAlloc.
Potential Reproduction Steps
Note: These are suggested steps for an attacker; we do not have a working proof of concept.
- From a compromised renderer, call
media.mojom.InterfaceFactory::CreateCastRendererwith a generatedoverlay_plane_idto obtain a browser-processmedia.mojom.Rendererremote. - Call
Renderer::Initializewith a valid media configuration (e.g., AAC/H264) and wait for the success callback. This successfully allocates theSbPlayer. - Call
Renderer::Initializeagain on the same remote, this time providing an invalid configuration (e.g., advertisingAudioCodec::kAMR_NB). This frees theSbPlayerbut leaves a dangling pointer inGeometryChangeHandler. - Submit a compositor frame from the renderer containing a
VideoHoleDrawQuad. Set itsoverlay_plane_idto match the one from Step 1, and set its bounds to arbitrary values payload. - The Viz process will forward the bounds to the browser process, triggering a write to the freed
SbPlayermemory.
Suggested Fix
There are two places where this should be addressed for defense-in-depth:
-
Prevent re-initialization at the Mojo boundary: In
MojoRendererService::Initialize, replace or supplement theDCHECKwith a hard check that terminates the renderer if it attempts to initialize twice:C++ if (state_ != STATE_UNINITIALIZED) { mojo::ReportBadMessage("MojoRendererService cannot be initialized multiple times"); return; } -
Clear the dangling pointer on failure: In
StarboardRenderer::Initialize, ensure theGeometryChangeHandler's pointer is cleared if player creation fails:C++ if (!player_manager_) { geometry_change_handler_.SetSbPlayer(nullptr); // ADD THIS LINE LOG(ERROR) << "Unable to create StarboardPlayerManager"; // ... return; }
Evaluated with Chrome root at commit: 661452647ddb2827305122ff3273bd5dea403f09
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 a debug-only check (DCHECK) that is removed in release builds allows re-initialization, and the failure path does not clear a dangling pointer in GeometryChangeHandler.
Impact
A compromised renderer could achieve a highly controllable write-after-free in the browser process, potentially leading to code execution or sandbox escape.
What the attacker needed
Compromised renderer; Starboard build of Cast
The fix
The report suggests adding a hard check to reject re-initialization at the Mojo boundary and clearing the dangling pointer in GeometryChangeHandler when player creation fails.
How it was found
- From a compromised renderer, call CreateCastRenderer to obtain a browser-process Renderer remote.
- Call Renderer::Initialize with a valid media configuration and wait for success.
- Call Renderer::Initialize again on the same remote with an invalid configuration to free the player.
- Submit a compositor frame containing a VideoHoleDrawQuad with the original overlay_plane_id and arbitrary bounds.
- The Viz process forwards the bounds to the browser process, triggering a write to freed memory.
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 frees some memory but keeps a pointer to it, then later writes through that pointer. Here, a malicious web page (running in a sandboxed renderer) can ask the browser to set up a media player twice; the second setup fails and frees the player, but a leftover pointer is still used when the page sends a special drawing instruction, letting the attacker write to memory they no longer own.
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.