Integer overflow in Chromecast (CVE-2026-16416)
The Chromecast mixer service may accept unauthenticated local connections and parse stream parameters without clamping, allowing an integer overflow that allocates an undersized buffer. An attacker with a local foothold could then send audio data to cause a controlled heap out-of-bounds write in the browser process.
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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: The Chromecast mixer service potentially listens on an unauthenticated abstract-namespace UNIX domain socket. An attacker with a local foothold could supply stream parameters that trigger an integer overflow during buffer pool allocation. This could result in an undersized buffer allocation and subsequent controlled heap out-of-bounds write in the browser process.
Affected files:
chromecast/media/audio/net/audio_socket_service_uds.cc
Estimated timestamp from git blame: 2019-11-15
Description
A potential integer overflow and narrowing vulnerability exists in the Chromecast MixerInputConnection::CreateBufferPool function. When MIXER_IN_CAST_SHELL is enabled, the mixer service runs inside the privileged cast_shell browser process and listens on an abstract-namespace UNIX domain socket (/tmp/mixer-service) with an authentication callback that may unconditionally accept incoming connections.
An attacker with a local foothold (e.g., from a compromised sandboxed process such as a utility or GPU process, or another local daemon) could connect to this abstract socket and send a malicious kMetadata message containing custom output_stream_params parameters.
In the MixerInputConnection constructor, params.fill_size_frames() is parsed without clamping and passed to CreateBufferPool(int frame_count):
void MixerInputConnection::CreateBufferPool(int frame_count) {
DCHECK_GT(frame_count, 0);
buffer_pool_frames_ = frame_count;
int converted_buffer_size =
kAudioMessageHeaderSize + num_channels_ * sizeof(float) * frame_count;
buffer_pool_ = base::MakeRefCounted<IOBufferPool>(converted_buffer_size, ...);
...
}
If the attacker controls num_channels_ (e.g., 2) and provides a large frame_count (e.g., 0x20000001 or 536870913), the multiplication in size_t (on 64-bit platforms) evaluates to:
$$2 \times 4 \times 536870913 = 4294967304 \text{ (0x100000008)}$$
Adding kAudioMessageHeaderSize (16 bytes) results in 4294967320 (0x100000018). When this value is implicitly narrowed and stored into the 32-bit signed integer converted_buffer_size, it truncates to 24 bytes.
An IOBufferPool is then created with a size of only 24 bytes, while the capacity state buffer_pool_frames_ retains the large original value 536870913. When the attacker subsequently sends a kAudio message containing valid audio data (e.g., 100 frames), the size checks against buffer_pool_frames_ pass, and ConvertInterleavedData writes the converted floats directly into the undersized 24-byte heap buffer, leading to a controlled linear out-of-bounds write.
Note: Our tooling does not currently have the capability to run code, and parts of the CMA backend mixer implementation are not present in the public repository, so these findings are based on static analysis of the public interfaces and reference files.
Potential Attack Steps
- Establish a socket connection to the abstract address
\0/tmp/mixer-servicefrom a process with local network capabilities. - Send a structured
kMetadatamessage withnum_channels = 2andfill_size_frames = 536870913. - Send a follow-up
kAudiomessage with a moderate number of frames (e.g., 100 frames of INT16 PCM data). - This would cause the receiver to allocate a 24-byte buffer and write 800 bytes of converted float data into it, corrupting adjacent heap objects in the
cast_shellbrowser process.
Suggested Fix
To prevent this vulnerability, enforce strict clamping and bounds validation on all incoming stream parameters in the MixerInputConnection constructor and use safe arithmetic (such as base::CheckedNumeric) when calculating buffer sizes:
base::CheckedNumeric<int> safe_buffer_size = kAudioMessageHeaderSize;
safe_buffer_size += base::CheckedNumeric<int>(num_channels_)
* sizeof(float)
* frame_count;
if (!safe_buffer_size.IsValid()) {
// Handle error, reject connection
}
int converted_buffer_size = safe_buffer_size.ValueOrDie();
Evaluated with Chrome root at commit: d8b226a3be7c9c1ac9240c09e14698866c82e4ac
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.
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 lack of bounds validation and safe arithmetic when converting attacker-controlled frame counts and channel counts into a 32-bit buffer size, causing an integer truncation.
Impact
A local attacker could corrupt heap memory in the privileged browser process, potentially leading to code execution, though the report notes the analysis is static and the code was not run.
What the attacker needed
Local foothold on the device; ability to connect to the mixer socket
The fix
The code should clamp incoming stream parameters and use checked arithmetic when calculating buffer sizes, rejecting invalid values.
How it was found
- Connect to the abstract UNIX socket used by the mixer service.
- Send a metadata message with a large frame count and a small channel count.
- Send an audio message with a moderate number of frames.
- The service writes converted audio data past the undersized 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 local program can talk to a service inside the browser and send numbers that are not checked. When those numbers are multiplied, the result is too big for the variable that stores it, so it wraps around to a tiny value. The service then creates a very small memory buffer but still believes it is huge, so later data spills over into nearby 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.