Integer overflow in Media (CVE-2026-11655)
An integer truncation in a macOS audio utility causes an undersized heap allocation when a large channel count is supplied, leading to a linear out-of-bounds write. A compromised renderer could potentially exploit this to corrupt the GPU process heap and achieve remote code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 25 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: An integer truncation vulnerability in the macOS-specific audio utility code allows for an undersized heap allocation when processing high channel counts. A compromised renderer can potentially exploit this to trigger a massive linear heap out-of-bounds write in the GPU process. The issue stems from a 64-bit to 32-bit truncation during a buffer size calculation.
Affected files:
media/base/mac/channel_layout_util_mac.ccmedia/filters/mac/audio_toolbox_audio_decoder.ccmedia/base/mac/channel_layout_util_mac.h
Estimated timestamp from git blame: 2023-04-27
Summary
A potential linear heap out-of-bounds (OOB) write vulnerability exists in the macOS GPU process due to an integer truncation in media::ChannelLayoutToAudioChannelLayout. When calculating the required size for an AudioChannelLayout structure, a 64-bit size_t value is truncated into a 32-bit int, leading to an undersized heap allocation. Subsequent initialization of the structure's members results in a linear OOB write.
Root Cause Analysis
The vulnerability is located in media/base/mac/channel_layout_util_mac.cc within the ChannelLayoutToAudioChannelLayout function:
std::unique_ptr<ScopedAudioChannelLayout> ChannelLayoutToAudioChannelLayout(
ChannelLayout input_layout, int input_channels) {
// ...
int output_layout_size = // [1] Truncation occurs here
offsetof(AudioChannelLayout, mChannelDescriptions[input_channels]);
auto new_layout =
std::make_unique<ScopedAudioChannelLayout>(output_layout_size); // [2] Undersized allocation
new_layout->layout()->mNumberChannelDescriptions = input_channels; // [3] Large count stored
// ...
auto descriptions = GetDescriptions(*new_layout->layout());
if (input_layout == CHANNEL_LAYOUT_DISCRETE) {
for (int ch = 0; ch < input_channels; ++ch) {
descriptions[ch].mChannelLabel = kAudioChannelLabel_Unknown; // [4] OOB write
descriptions[ch].mChannelFlags = kAudioChannelFlags_AllOff;
}
}
- Truncation: In
[1],offsetofreturns a 64-bitsize_t. For a sufficiently largeinput_channels(e.g.,214,748,365), the result12 + (214,748,365 * 20) = 4,294,967,312(0x100000010) is truncated when assigned to the 32-bit signedintoutput_layout_size, resulting in a value of16. - Allocation: In
[2], abase::HeapArrayof only 16 bytes is allocated. - Inconsistent State: In
[3], the structure's member count is set to the original large value. TheGetDescriptionshelper subsequently creates abase::spanwhose length is based on this large value, bypassing span safety checks for the underlying small allocation. - OOB Write: In
[4], the loop iteratesinput_channelstimes, performing writes starting at offset 12 and continuing linearly well beyond the 16-byte buffer.
Potential Attack Vector
Note: These are potential steps as a functional PoC has not yet been executed.
- A compromised renderer binds the
media.mojom.AudioDecoderinterface in the GPU process (on macOS, this often instantiatesAudioToolboxAudioDecoder). - The renderer calls
Initialize()with anAudioDecoderConfigwherecodeciskAACandprofileiskXHE_AAC(xHE-AAC/USAC). - The
extra_datafield is crafted to contain a USAC configuration that specifies an extremely large channel count (e.g., via ISO/IEC 23003-3escapedValuesyntax). AudioToolboxAudioDecoder::CreateDecoderuses macOSAudioFormatGetPropertyto parse the configuration. If the system API returns the large channel count inmChannelsPerFrame, it triggers the calls toChannelLayoutToAudioChannelLayoutwith the malicious count.
Impact
This flaw could allow a compromised renderer to achieve Remote Code Execution (RCE) in the GPU process by corrupting the PartitionAlloc heap. On macOS, the GPU process is sandboxed but maintains access to system audio/graphics frameworks.
Suggested Fix
- Use
base::CheckedNumeric<size_t>to perform the size calculation inChannelLayoutToAudioChannelLayoutand ensure the result fits in asize_tand is within sane bounds before allocation. - Change the type of
output_layout_sizefrominttosize_tto avoid truncation. - Implement explicit validation of the channel count in
AudioToolboxAudioDecoderbefore passing it to utility functions, enforcing limits such asmedia::limits::kMaxChannels.
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.
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 64-bit size calculation result was stored in a 32-bit signed integer, truncating the value and causing an undersized allocation before a loop wrote the full channel count.
Impact
A compromised renderer could potentially achieve remote code execution in the sandboxed GPU process by corrupting the heap, though no functional proof of concept has been executed.
What the attacker needed
Compromised renderer; macOS; crafted audio configuration
The fix
The size calculation should use checked arithmetic and a size_t type, and the channel count should be validated against a maximum limit before allocation.
How it was found
- A compromised renderer binds the AudioDecoder interface in the GPU process.
- The renderer calls Initialize with an AAC xHE-AAC configuration.
- The extra_data field contains a USAC configuration specifying an extremely large channel count.
- The macOS audio API parses the configuration and returns the large channel count.
- The large count reaches ChannelLayoutToAudioChannelLayout, causing the truncation and OOB write.
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.
When a program needs memory for a list of items, it calculates the size and asks the system for that much space. Here, a very large number was cut down to a small number during that calculation, so the program reserved far too little memory. It then wrote a long list of items into that tiny space, spilling over into neighbouring memory and corrupting it.
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.