Skip to content
Memory corruption Advisory Advanced CVE-2026-17770

Out of bounds read in Media (CVE-2026-17770)

A logic error in the macOS video frame wrapping function causes the advertised stride to exceed the actual buffer size when a frame has a non-zero horizontal offset, leading to an out-of-bounds read in the GPU process. An attacker who has compromised the renderer could potentially leak GPU process memory into the encoded video bitstream.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

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 without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A logic error in WrapVideoFrameInCVPixelBuffer causes an over-advertisement of a video frame's stride when a frame has a non-zero horizontal offset. This can lead to the macOS VideoToolbox framework performing an out-of-bounds read of the GPU process memory.

Affected files:

  • media/base/mac/video_frame_mac.mm
  • media/base/video_frame.cc
  • media/mojo/mojom/video_frame_mojom_traits.cc
  • media/mojo/services/mojo_video_encode_accelerator_service.cc
  • media/gpu/mac/vt_video_encode_accelerator_mac.mm

Estimated timestamp from git blame: 2016-03-28

Description

A potential memory safety vulnerability exists in the macOS-specific video frame wrapping logic within the GPU process. The function WrapVideoFrameInCVPixelBuffer in media/base/mac/video_frame_mac.mm miscalculates the memory bounds of a CVPixelBuffer when the source VideoFrame has a non-zero X-offset in its visible_rect.

Root Cause Analysis

In media/base/mac/video_frame_mac.mm, WrapVideoFrameInCVPixelBuffer() builds a CVPixelBuffer to pass to the macOS VideoToolbox API. To handle cropped frames, it sets the base address for each plane using frame->visible_data(plane_i), which returns a pointer offset by the visible_rect origin. However, the code continues to use the full coded stride (frame->stride(plane_i)) for the plane_bytes_per_row parameter.

C++
// media/base/mac/video_frame_mac.mm
for (int plane_i = 0; plane_i < num_planes; ++plane_i) {
  UNSAFE_TODO(plane_ptrs[plane_i]) =
      const_cast<uint8_t*>(frame->visible_data(plane_i));
  // ...
  UNSAFE_TODO(plane_bytes_per_row[plane_i]) = frame->stride(plane_i); // Potential Vulnerability
}

If a VideoFrame is backed by shared memory and the mapping is sized minimally for the frame's coded dimensions, this combination of an offset pointer and a full stride causes the system API to believe the buffer extends past the actual end of the mapping.

For example, consider a 1024x1024 frame with a stride of 1024. If the visible_rect starts at x=512, the pointer passed to the OS is BaseAddress + 512. If the visible height is 1024, the OS is told there are 1024 rows, each with a stride of 1024. On the final row, the OS will attempt to read 1024 bytes starting from BaseAddress + 512 + (1023 * 1024). However, the original allocation only extends to BaseAddress + (1024 * 1024). This results in an out-of-bounds read of 512 bytes.

Potential Exploit Scenario

An attacker who has compromised a renderer process could potentially follow these steps:

  1. Initialize Encoder: Bind to media::mojom::VideoEncodeAcceleratorProvider and initialize an encoder (e.g., PIXEL_FORMAT_NV12).
  2. Craft Frame: Create a VideoFrame backed by a shared memory region sized exactly for the coded dimensions.
  3. Apply Crop: Set the visible_rect of the frame with a non-zero x offset (e.g., visible_rect = (512, 0, 512, 1024)).
  4. Trigger OOB Read: Send the frame for encoding via Mojo. In the GPU process, VTVideoEncodeAccelerator will call WrapVideoFrameInCVPixelBuffer(), and the resulting over-advertised CVPixelBuffer will be passed to the system encoder.
  5. Information Leak: If the system encoder reads the over-advertised region, the OOB memory from the GPU process may be encoded into the output video bitstream and returned to the renderer.

Impact

This issue allows an out-of-bounds read in the GPU process. Because the GPU process is shared across origins, a successful exploit could lead to the disclosure of cross-origin data or a process crash. On macOS, the GPU process is sandboxed, but an information leak here could assist in a broader attack chain.

Suggested Fix

In media/base/mac/video_frame_mac.mm, WrapVideoFrameInCVPixelBuffer should be updated to ensure that the combination of the base pointer offset and the advertised stride does not exceed the allocated buffer size. If the visible_rect has a non-zero x offset, the function should either:

  1. Reduce the advertised plane_bytes_per_row if the underlying API allows it while maintaining alignment.
  2. Perform a copy of the visible data into a new, correctly sized buffer before wrapping.
  3. Reject frames where the horizontal offset would lead to an OOB read when using the coded stride.

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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 function uses a pointer offset by the visible rectangle's origin but keeps the full coded stride, so the system API believes the buffer extends beyond the actual allocation.

Impact

This could lead to the disclosure of cross-origin data or a process crash; the GPU process is sandboxed on macOS, but the leak could assist in a broader attack chain.

What the attacker needed

Compromised renderer process; macOS with VideoToolbox; ability to send Mojo messages

The fix

The function should be updated to ensure the combination of base pointer offset and advertised stride does not exceed the allocated buffer size, for example by reducing the advertised stride, copying the visible data into a correctly sized buffer, or rejecting frames with a horizontal offset that…

How it was found

  1. Bind to the video encode accelerator provider and initialise an encoder.
  2. Create a VideoFrame backed by shared memory sized exactly for the coded dimensions.
  3. Set the visible_rect with a non-zero x offset.
  4. Send the frame for encoding via Mojo, triggering the wrap function in the GPU process.
  5. The system encoder reads the over-advertised region, potentially leaking GPU process memory into the output bitstream.

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 video frame is cropped, the code tells the operating system that each row of pixels is longer than it really is. The system then reads past the end of the memory buffer, which can leak data from other parts of the GPU process. This only matters if an attacker has already broken into the renderer process.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.