Out of bounds read VideoCapture (CVE-2026-12033)
A renderer-side video capture path accepted custom plane strides without checking they were at least the minimum row bytes for the frame width, so a frame could be created with a huge width and a tiny stride. A compromised GPU process could then trigger an out-of-bounds read of up to 32 KiB from the renderer heap when the frame is copied.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 10 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 potential out-of-bounds read can occur in the renderer process during video capture when custom strides are used. A compromised GPU process could send a video frame with custom strides smaller than the minimum row bytes for the specified width, bypassing the checks in VideoCaptureImpl. This can lead to an out-of-bounds read inside libyuv::I420Copy.
Affected files:
third_party/blink/renderer/platform/video_capture/video_capture_impl.ccmedia/base/video_frame.cc
Estimated timestamp from git blame: 2018-09-18
Description
A potential out-of-bounds read vulnerability has been identified in VideoCaptureImpl in the renderer process.
In VideoCaptureImpl::ProcessBuffer (third_party/blink/renderer/platform/video_capture/video_capture_impl.cc:285-331), when a video frame is processed with custom strides via the kUnsafeShmemRegion handle path, the code verifies that the backing shared memory span is large enough to contain rows * stride for each plane. However, it does not validate that the custom stride is at least as large as the minimum required bytes per row for the given width (i.e., stride >= VideoFrame::RowBytes(...)).
Since VideoFrame::WrapExternalYuvData does not perform further validation of strides against width, a VideoFrame can be created with an extremely small stride but a large width. Subsequent consumers of this frame, such as WebMediaPlayerMSCompositor::CopyFrame (which utilizes libyuv::I420Copy), copy data based on the frame's logical width. This causes memcpy operations to read past the boundary of the shared memory mapping.
Suggested Attack Flow (Potential Steps)
Note: The following are potential steps based on source code analysis; our analysis tooling does not have the ability to execute code to verify this.
- A compromised GPU process calls
OnFrameCapturedvia theviz::mojom::FrameSinkVideoConsumerremote. - The IPC payload specifies a tiny shared memory region (e.g., 8 bytes), a large frame size (e.g.,
coded_size = {8192, 4}), and invalid strides (e.g.,strides = {1, 1, 1, 0}). - The browser process relays this frame to the renderer process without validation.
- The renderer process maps the 8-byte shared memory buffer in
BufferContext. - In
VideoCaptureImpl::ProcessBuffer, the validationRows * stridechecks pass because4 * 1 = 4(Y plane) and2 * 1 = 2(U/V planes) fit within the 8-byte buffer. - The
VideoFrameis created with a logical width of 8192 and strides of 1. - When the video is paused or copied in
WebMediaPlayerMSCompositor::ReplaceCurrentFrameWithACopy,libyuv::I420Copyattempts to copy 8192 bytes per row. - This results in an out-of-bounds read of up to 32 KiB from the renderer's heap.
Code References
-
Vulnerable Code Location:
third_party/blink/renderer/platform/video_capture/video_capture_impl.cc:285-331 -
Missing Check Reference: In contrast, the sibling
FitsInContiguousBufferOfSizecheck (used by the non-strides path) correctly enforces this check:media/base/video_frame_layout.cc:254C++ size_t row_bytes = VideoFrame::RowBytes(plane_idx, format_, coded_size_.width()); if (plane.stride < row_bytes) { return false; }
Suggested Fix
To mitigate this issue, validate that custom strides are not less than the minimum required row bytes for the specified width.
For example, in third_party/blink/renderer/platform/video_capture/video_capture_impl.cc, add the following validation inside the strides branch:
for (size_t i = 0; i < 3; ++i) {
size_t row_bytes = media::VideoFrame::RowBytes(
i, video_frame_init_data.ready_buffer->info->pixel_format,
video_frame_init_data.ready_buffer->info->coded_size.width());
if (video_frame_init_data.ready_buffer->info->strides->stride_by_plane[i] < row_bytes) {
return false;
}
}
Evaluated with Chrome root at commit: 87214e6721f6c34afd9181b80769a24c0c601c50
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
The strides branch of VideoCaptureImpl::ProcessBuffer validated only that rows times stride fitted in the shared memory, not that each stride was at least VideoFrame::RowBytes for the coded width, and WrapExternalYuvData does not re-check this.
Impact
A compromised GPU process could cause an out-of-bounds read of up to 32 KiB from the renderer heap, though the report notes the steps are potential and were not executed.
What the attacker needed
Compromised GPU process
The fix
The strides branch should reject any plane whose stride is smaller than VideoFrame::RowBytes for the coded width, as the report suggests.
How it was found
- A compromised GPU process sends a captured frame over the FrameSinkVideoConsumer interface.
- The IPC payload uses a tiny shared memory region, a large coded size and invalid small strides.
- The browser process relays the frame to the renderer without validation.
- The renderer maps the small shared memory buffer.
- The rows times stride checks pass because the tiny strides fit in the small buffer.
- A VideoFrame is created with a large logical width and stride of one, and copying it reads past the 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.
Video frames are stored as rows of pixels, and a 'stride' is how many bytes each row takes up in memory. The code checked that the buffer was big enough for the number of rows times the stride, but never checked the stride was wide enough for the frame's stated width. A malicious or compromised GPU process could therefore hand over a frame that claims to be very wide but is backed by a tiny buffer, and when the renderer copies it, it reads memory past the end of the buffer.
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.