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

Use after free in Chromecast (CVE-2026-78939)

A use-after-free vulnerability exists in Chromecast's StarboardRenderer because a pointer to a stack-local audio configuration buffer is retained after the buffer is freed. A compromised renderer could potentially exploit this to achieve code execution in the unsandboxed browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

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 Use-After-Free (UAF) vulnerability exists in the StarboardRenderer component on Chromecast due to improper lifetime management of audio configuration data. A pointer to a stack-local buffer is retained and subsequently used during media playback after the buffer has been freed. This could potentially allow a compromised renderer process to achieve code execution in the unsandboxed browser process.

Affected files:

  • chromecast/starboard/media/renderer/starboard_player_manager.cc
  • chromecast/starboard/media/renderer/demuxer_stream_reader.cc
  • chromecast/starboard/media/renderer/chromium_starboard_conversions.cc
  • chromecast/starboard/media/renderer/demuxer_stream_reader.h
  • chromecast/starboard/media/media/starboard_api_wrapper.h

Estimated timestamp from git blame: 2025-06-05

Summary

A potential Use-After-Free (UAF) vulnerability has been identified in the StarboardRenderer implementation used on Chromecast. The issue occurs because StarboardPlayerManager retains a dangling raw pointer to an AudioDecoderConfig buffer that is destroyed immediately after initialization. This dangling pointer is used for every audio sample written to the Starboard platform API, potentially leading to memory corruption in the unsandboxed browser process.

Root Cause Analysis

In StarboardPlayerManager::Create (chromecast/starboard/media/renderer/starboard_player_manager.cc), a stack-local ::media::AudioDecoderConfig object is created to store the initial audio configuration:

C++
// line 35
::media::AudioDecoderConfig audio_config;
// ...
// line 48
audio_config = audio_stream->audio_decoder_config();
// line 49
audio_sample_info = ToStarboardAudioSampleInfo(audio_config);

The function ToStarboardAudioSampleInfo (chromecast/starboard/media/renderer/chromium_starboard_conversions.cc) converts this configuration into a StarboardAudioSampleInfo structure. During this conversion, it captures a raw pointer to the configuration's internal extra_data buffer:

C++
// line 304
out_config.audio_specific_config_size = in_config.extra_data().size();
// line 305
out_config.audio_specific_config = in_config.extra_data().data();

This structure, containing the pointer to the stack-local audio_config's heap buffer, is stored in DemuxerStreamReader::audio_sample_info_. However, once StarboardPlayerManager::Create returns, the stack-local audio_config is destroyed, and its internal extra_data buffer is freed.

Crucially, DemuxerStreamReader does not save the AudioDecoderConfig during its initial construction to keep the buffer alive, even though it has a member chromium_audio_config_ intended for this purpose. This member is only populated during mid-stream configuration changes in UpdateAudioConfig.

Impact

Every subsequent audio sample processed by DemuxerStreamReader::OnReadBuffer copies this dangling pointer into the sample information passed to the Starboard API:

C++
// chromecast/starboard/media/renderer/demuxer_stream_reader.cc:255
sample_info.audio_sample_info = *audio_sample_info_;

The Starboard platform implementation (e.g., SbPlayerWriteSample2) then dereferences this dangling pointer in the unsandboxed browser process. A compromised renderer can control the contents and size of the extra_data buffer, making this a potential path for a sandbox escape and remote code execution (RCE) in the browser process.

Potential Replication Steps

  1. Compromise a renderer process on a Chromecast device.
  2. Trigger media playback using StarboardRenderer (e.g., by providing a specific audio configuration via Mojo).
  3. Reallocate the freed extra_data buffer in the browser process with attacker-controlled data (e.g., via heap spraying or other IPCs).
  4. Observe the browser process crash or exhibit controlled behavior when SbPlayerWriteSample2 is called with the corrupted configuration data.

Note: These steps are based on static analysis of the code flow; a functional proof-of-concept has not been executed.

Suggested Fix

The DemuxerStreamReader should ensure the initial AudioDecoderConfig is preserved. In DemuxerStreamReader::DemuxerStreamReader (chromecast/starboard/media/renderer/demuxer_stream_reader.cc:85), the constructor should store the current configuration from the stream into chromium_audio_config_ if the stream exists.

Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e


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.

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

Likely, the DemuxerStreamReader does not copy the initial AudioDecoderConfig into its member variable, so the pointer to the extra_data buffer becomes dangling after the stack-local config is destroyed.

Impact

A compromised renderer could potentially achieve code execution in the unsandboxed browser process, leading to sandbox escape and remote code execution.

What the attacker needed

Compromised renderer process; Chromecast device

How it was found

  1. Compromise a renderer process on a Chromecast device.
  2. Trigger media playback using StarboardRenderer with a specific audio configuration.
  3. Reallocate the freed extra_data buffer with attacker-controlled data.
  4. Observe browser process crash or controlled behaviour when SbPlayerWriteSample2 is called.

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 after it has been freed, and then uses it later. Here, the code saves a pointer to a temporary audio configuration, but that configuration is destroyed when the function returns, leaving a dangling pointer. When the program later uses that pointer, it may read or write memory that has been reallocated, potentially allowing an attacker to control what happens.

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.