Integer overflow in Media (CVE-2026-11669)
A size_t to int truncation when handling video frame strides lets a compromised renderer pass buffer bounds checks in the GPU process. The attacker could then read out-of-bounds GPU process memory and leak it back through encoded video bitstreams.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 19 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: A type truncation from size_t to int when handling video frame strides allows a compromised renderer to bypass memory safety checks in the GPU process. Specifically, crafted strides can trigger signed integer wraparound, causing buffer bounds checks to pass incorrectly. This results in out-of-bounds memory reads that can be leaked via encoded video bitstreams.
Affected files:
media/gpu/chromeos/video_frame_resource.ccmedia/base/video_frame.ccmedia/gpu/chromeos/libyuv_image_processor_backend.ccmedia/mojo/mojom/video_frame_mojom_traits.cc
Estimated timestamp from git blame: 2024-11-19
Summary
A potential vulnerability in the ChromeOS video processing pipeline allows a compromised renderer to disclose memory from the privileged GPU process. The issue arises from a size_t to int truncation when handling video frame strides, combined with modular signed integer arithmetic that can bypass internal buffer safety checks.
Root Cause Analysis
The primary issue exists in the interaction between media::VideoFrame and media::VideoFrameResource (used primarily on ChromeOS). While the underlying VideoFrameLayout correctly stores plane strides as size_t (64-bit on 64-bit architectures), several accessors and internal processing functions truncate these values to 32-bit signed int before use.
Specifically:
VideoFrameResource::stride(size_t plane)(inmedia/gpu/chromeos/video_frame_resource.cc) returns anint, while the underlyingVideoFrame::stride()returns asize_t(up to 64 bits).VideoFrame::GetVisibleDataInternal()(inmedia/base/video_frame.cc) truncates the stride to a localint plane_stridebefore calculating the visible plane size for bounds checking.
Because Chromium is compiled with -fno-strict-overflow, signed integer arithmetic follows modular wraparound rules. An attacker can provide a frame with a logical stride of 0x80000000 (2GB), which truncates to INT_MIN (-2147483648) when converted to a signed 32-bit int. In the calculation for the visible plane size:
visible_plane_size = plane_stride * (rows - 1) + row_bytes
If the frame has an odd number of visible rows (e.g., 3), the term INT_MIN * 2 wraps exactly to 0 in 32-bit signed modular arithmetic. This results in a small, positive visible_plane_size, causing the base::span::subspan() memory safety check to pass even though the stride is logically incorrect.
Potential Attack Vector (Suggested Steps)
- Compromise Renderer: The attacker starts from a compromised renderer process.
- Mojo Communication: The attacker utilizes the
mojom::VideoEncodeAcceleratorMojo interface to send a craftedVideoFrameto the GPU process. - Craft Malicious Frame: The attacker prepares a
STORAGE_SHMEMorSTORAGE_DMABUFSframe with an odd visible height (e.g., 3), a stride of0x80000000, and a shared memory region large enough (approx. 4.1GB) to satisfy initial layout validation. - Trigger Image Processing: The GPU process receives the frame and, depending on the hardware encoder requirements, invokes the
LibYUVImageProcessorBackendfor format conversion or scaling. - Out-of-Bounds Read: During processing,
LibYUVuses the truncated negative stride to move between rows. Because pointers are 64-bit, adding the truncated signedint(effectively -2GB) causesLibYUVto read from memory locations 2GB and 4GB before the intended shared memory mapping. - Exfiltrate Data: The data read from these out-of-bounds locations is encoded into the output video bitstream and sent back to the renderer, allowing the attacker to recover privileged GPU process memory.
Impact
This issue provides a potential high-bandwidth memory disclosure primitive from the GPU process, which is unsandboxed on ChromeOS. This could be used to leak sensitive data or to assist in a multi-stage exploit to gain full control of the GPU process.
Suggested Fix
- Update the
FrameResourcehierarchy andVideoFrameResource::stride()to returnsize_tinstead ofintto maintain consistency withmedia::VideoFrame. - Audit
media/base/video_frame.ccto ensure that all stride-related arithmetic inGetVisibleDataInternaland other functions usessize_torbase::CheckedNumericto prevent truncation and overflow. - Improve validation in Mojo traits to reject excessively large strides that are not practical for legitimate video frames but can be used to trigger arithmetic issues in downstream components.
Evaluated with Chrome root at commit: 29093e11cf509e3593f6229e4b1b075cca356049
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 size_t to int truncation of video frame strides combined with modular signed arithmetic, so the visible plane size calculation wraps to a small positive value and the bounds check passes.
Impact
This could provide a high-bandwidth memory disclosure from the GPU process, which is unsandboxed on ChromeOS, and may assist a multi-stage exploit to take control of that process.
What the attacker needed
Compromised renderer process; ChromeOS GPU pipeline; large shared memory region (~4.1GB)
The fix
The stride accessors and related arithmetic should use size_t or checked numeric types, and Mojo validation should reject impractically large strides.
How it was found
- Start from a compromised renderer process.
- Send a crafted VideoFrame to the GPU process over the VideoEncodeAccelerator Mojo interface.
- Prepare a frame with an odd visible height, a stride of 0x80000000 and a large enough shared memory region to pass initial validation.
- The GPU process invokes the LibYUV image processor backend for conversion or scaling.
- LibYUV uses the truncated negative stride to read memory before the intended mapping.
- The out-of-bounds data is encoded into the output bitstream and returned to the renderer.
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 stride is the number of bytes between the start of one row of an image and the next. Here a very large stride value gets squeezed into a smaller signed number, which wraps around to a negative value, so a size check that should fail passes instead. A program that is already broken into (the renderer) could then make the graphics process read memory it should not and send it back inside a video.
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.