Heap buffer overflow in Chromecast (CVE-2026-9123)
A heap buffer overflow exists in the ConvertPlanarFloat function because a debug-only check (DCHECK_EQ) is compiled out in release builds, allowing an attacker-controlled audio message to specify more frames than the destination buffer can hold. An attacker who can impersonate the audio capture service over a local UNIX socket could write past the end of a heap buffer with controlled data.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 56 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A potential heap buffer overflow exists in ConvertPlanarFloat when handling audio capture messages over a UNIX domain socket. The function relies on a DCHECK_EQ to verify the incoming data size fits the AudioBus capacity, which is compiled out in release builds, allowing an attacker-controlled message to cause an out-of-bounds write via std::copy.
Affected files:
chromecast/media/audio/capture_service/message_parsing_utils.ccchromecast/media/audio/cast_audio_input_stream.ccchromecast/media/audio/net/audio_socket_service_uds.cc
Estimated timestamp from git blame: 2025-12-11
Vulnerability Analysis
A potential heap buffer overflow exists in the ConvertPlanarFloat function within chromecast/media/audio/capture_service/message_parsing_utils.cc. This function is responsible for copying float audio data received over a socket into a media::AudioBus.
The function calculates the number of audio frames directly from the size of the received data payload:
const int frames = CheckAudioData<float>(channels, data, data_size);
It then verifies that this number of frames matches the capacity of the target AudioBus using a DCHECK_EQ:
DCHECK_EQ(frames, audio->frames());
Because DCHECK_EQ is compiled out in release builds, there is no active bounds checking in production. The code proceeds to copy the data into the AudioBus channels using std::copy and a raw pointer obtained via .data():
for (int c = 0; c < channels; ++c) {
const float* source = UNSAFE_TODO(base_data + c * frames);
std::copy(source, UNSAFE_TODO(source + frames), audio->channel(c).data());
}
If the incoming data_size implies a frames count larger than the AudioBus capacity, std::copy will write past the end of the AudioBus channel's backing memory, causing a heap buffer overflow.
Attack Vector
The vulnerability is reachable by an attacker who can impersonate the audio capture service. The service communicates via an abstract-namespace Unix Domain Socket (UDS) located at \0/tmp/capture-service (defined as kDefaultUnixDomainSocketPath). Because abstract-namespace sockets are not protected by filesystem permissions, any local process that shares the host network namespace (such as a compromised GPU or renderer process) can bind to this address if the legitimate service hasn't already done so.
Potential steps to trigger the vulnerability:
- A local attacker binds to
\0/tmp/capture-servicebefore the legitimate capture service. - A browser component, such as
CastAudioManagerAlsa, requests audio input, instantiating aCastAudioInputStreamand connecting to the socket. - The browser process sends a handshake request. The attacker responds with a handshake acknowledgement, specifying the
sample_formatasPLANAR_FLOAT(value 5). - The browser unconditionally accepts the
PLANAR_FLOATformat. - The attacker sends a PCM audio message (
kPcmAudio) with a payload size that exceeds the pre-allocatedAudioBuscapacity (e.g., sending several kilobytes for a small buffer). - The browser process reads the message via
SmallMessageSocketand passes the oversized payload toConvertPlanarFloat. - In release builds, the
DCHECK_EQis bypassed, andstd::copyoverflows theAudioBusheap buffer with attacker-controlled data.
(Note: These are potential steps as the AI agent cannot execute code to verify a full exploit chain.)
Suggested Fix
Replace the DCHECK_EQ with a standard CHECK_EQ or a conditional return to enforce the bounds check in all builds. Additionally, consider using base::span::copy_from to ensure memory safety when copying into the AudioBus channel.
const int frames = CheckAudioData<float>(channels, data, data_size);
if (frames <= 0 || frames != audio->frames()) {
return false;
}
Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8
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. Please feel free to reach out to me if you have concerns or feedback.
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
Impact
A local attacker who can bind to the socket before the legitimate service could cause a heap buffer overflow with attacker-controlled data, potentially leading to memory corruption or code execution.
What the attacker needed
Local access to the host network namespace; ability to bind the socket before the service; release build of the browser
The fix
The fix should replace the debug-only assertion with a runtime check that returns an error when the frame count does not match the buffer capacity, and optionally use a safe copy function.
How it was found
- A local attacker binds to the abstract-namespace UNIX socket before the legitimate capture service.
- A browser component requests audio input, creating a CastAudioInputStream that connects to the socket.
- The browser sends a handshake request; the attacker replies with an acknowledgement specifying PLANAR_FLOAT format.
- The browser accepts the format unconditionally.
- The attacker sends a PCM audio message with a payload size larger than the pre-allocated AudioBus capacity.
- The browser reads the message and passes the oversized payload to ConvertPlanarFloat, where std::copy overflows the heap buffer.
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 program that receives audio data over a local socket trusts a size value from the sender. In release builds, a safety check that would normally catch a too-large size is removed, so the program copies more data than the destination buffer can hold, overwriting nearby memory. An attacker who can pretend to be the audio service could exploit this to corrupt memory.
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.