High chrome Integer Overflow 📄 Reporter bug report 🔧 Commit mapped

Overview

High
Severity
CVSS
No
Exploited ITW
Fixed
Fix Status
ImpactInteger overflow in Chromecast
DescriptionInteger overflow in Chromecast
ComponentChromecast
Bug ClassInteger Overflow
Tracker520172356
Fix commitbbcbc329c355 (chromium/src) +4/-4
CISA KEVNot listed
CreditedGoogle
Disclosed2026-07-21

Changed Functions

FunctionChangeNotes
BindRepeating
chromecast/media/audio/net/audio_socket_service_uds.cc
modified

Files Changed

  • chromecast/media/audio/net/audio_socket_service_uds.cc
From bbcbc329c3558c7a5c8e73d4deb8db576d530b99 Mon Sep 17 00:00:00 2001
From: Simeon Anfinrud <[email protected]>
Date: Tue, 14 Jul 2026 11:02:09 -0700
Subject: [PATCH] [chromecast] Secure AudioSocketService UDS with client UID checks

This restricts connections to the abstract UNIX domain socket used by
AudioSocketService to only the same user (UID) that started the service
or root.

Bug: 520172356
Test: cast_media_unittests --gtest_filter='*AudioSocketServiceTest*'
Change-Id: Ie81c56652bec99c7259f53c65372b769c50a84e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8008788
Commit-Queue: Shawn Quereshi <[email protected]>
Auto-Submit: Simeon Anfinrud <[email protected]>
Reviewed-by: Shawn Quereshi <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1661998}
---

diff --git a/chromecast/media/audio/net/audio_socket_service_uds.cc b/chromecast/media/audio/net/audio_socket_service_uds.cc
index 47af782f..801da06 100644
--- a/chromecast/media/audio/net/audio_socket_service_uds.cc
+++ b/chromecast/media/audio/net/audio_socket_service_uds.cc
@@ -60,10 +60,10 @@
   DCHECK(!endpoint.empty());
   LOG(INFO) << "Using endpoint " << endpoint;
   auto unix_socket = std::make_unique<net::UnixDomainServerSocket>(
-      base::BindRepeating([](const net::UnixDomainServerSocket::Credentials&) {
-        // Always accept the connection.
-        return true;
-      }),
+      base::BindRepeating(
+          [](const net::UnixDomainServerSocket::Credentials& credentials) {
+            return credentials.user_id == getuid() || credentials.user_id == 0;
+          }),
       true /* use_abstract_namespace */);
   int result = unix_socket->BindAndListen(endpoint, kListenBacklog);
   listen_socket_ = std::move(unix_socket);
Loading diff…

Original Bug Report

reported by [email protected]

Potential Integer Overflow in MixerInputConnection::CreateBufferPool leading to Heap OOB Write

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

  1. Establish a socket connection to the abstract address \0/tmp/mixer-service from a process with local network capabilities.
  2. Send a structured kMetadata message with num_channels = 2 and fill_size_frames = 536870913.
  3. Send a follow-up kAudio message with a moderate number of frames (e.g., 100 frames of INT16 PCM data).
  4. 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_shell browser 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.

View on issue tracker