Skip to content
Info disclosure Advisory Advanced CVE-2026-17772

Out of bounds read in WebGL (CVE-2026-17772)

A WebGL2 fast path for uploading Y16 video frames failed to reset the UNPACK_ROW_LENGTH pixel store parameter, so a stale non-zero row length caused the GPU client to read past a tightly allocated temporary buffer. An attacker could then read the resulting texture back with readPixels and recover leaked renderer heap data, aiding ASLR bypass.

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 WebGL2's optimized Y16 video upload path allows an out-of-bounds (OOB) heap read in the renderer process. The implementation fails to reset the UNPACK_ROW_LENGTH parameter when performing a fast-path upload, causing the GLES2 client to over-read from a tightly-allocated temporary buffer. This can result in leaking sensitive renderer memory into a texture that can be read by JavaScript.

Affected files:

  • third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
  • media/renderers/paint_canvas_video_renderer.cc
  • gpu/command_buffer/client/gles2_implementation.cc
  • third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc

Estimated timestamp from git blame: 2016-12-04

Summary

A potential out-of-bounds (OOB) heap read exists in the WebGL2 implementation within Blink. When uploading a media::PIXEL_FORMAT_Y16 video frame using an optimized fast path, the implementation incorrectly gates the reset of GL unpack parameters. If certain WebGL-specific parameters like UNPACK_FLIP_Y_WEBGL are at their default values, the UNPACK_ROW_LENGTH parameter is not reset. Because the fast path uses a buffer tightly allocated for the image dimensions, a non-zero UNPACK_ROW_LENGTH causes the GPU client to read past the end of the buffer, leaking heap data into the resulting texture.

Root Cause Analysis

In WebGLRenderingContextBase::TexImageHelperMediaVideoFrame (located in third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc), an optimized path exists for PIXEL_FORMAT_Y16 frames. This path relies on source_image_rect_is_default to determine if a full-frame upload is occurring:

C++
// lines 6455-6460
const bool source_image_rect_is_default =
    params.unpack_skip_pixels == 0 && params.unpack_skip_rows == 0 &&
    (!params.width || *params.width == media_video_frame->natural_size().width()) &&
    (!params.height || *params.height == media_video_frame->natural_size().height());

This check is insufficient for WebGL2 because it does not account for UNPACK_ROW_LENGTH (or UNPACK_IMAGE_HEIGHT). Consequently, the fast path is entered even when a custom stride is set.

Furthermore, the path uses a ScopedUnpackParametersResetRestore object to manage GL state:

C++
// line 6497
ScopedUnpackParametersResetRestore unpack_params(
    this, unpack_flip_y_ || unpack_premultiply_alpha_); // Gated reset

The RAII object only calls ResetUnpackParameters() if its second argument is true. If both unpack_flip_y_ and unpack_premultiply_alpha_ are false, no reset occurs, leaving any previously set UNPACK_ROW_LENGTH active in the GL context.

PaintCanvasVideoRenderer then performs a tight allocation based only on the visible width and height:

C++
// media/renderers/paint_canvas_video_renderer.cc:1167
*temp_buffer = base::MakeRefCounted<DataBuffer>(
    output_row_bytes * frame->visible_rect().height());

Finally, when gl->TexSubImage2D is called (via media::PaintCanvasVideoRenderer::TexSubImage2D), the GLES2 client implementation (gpu/command_buffer/client/gles2_implementation.cc) computes the required data size based on the active (stale) UNPACK_ROW_LENGTH. If this value is greater than the frame's width, the implementation reads past the end of the allocated temp_buffer while copying data to the GPU transfer buffer.

Potential Impact

This is a highly reliable information leak that allows an attacker to read arbitrary renderer heap data adjacent to the temporary allocation. By reading the resulting texture back via gl.readPixels(), an attacker can recover leaked pointers or other sensitive data, aiding in ASLR bypass. This vulnerability requires a Y16 video source, which typically requires a depth camera and user permission via getUserMedia.

Suggested Steps to Reproduce (Potential)

  1. Initialize a WebGL2 context.
  2. Obtain a Y16 video stream (e.g., from a depth camera or virtual driver) via navigator.mediaDevices.getUserMedia.
  3. Set gl.pixelStorei(gl.UNPACK_ROW_LENGTH, width + offset) where offset > 0 and width is the video width.
  4. Ensure UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL are false (default).
  5. Call gl.texSubImage2D passing the video element as the source.
  6. Use gl.readPixels to extract the texture data; the extra bytes per row will contain leaked heap data.

Recommended Fix

Update source_image_rect_is_default in WebGLRenderingContextBase::TexImageHelperMediaVideoFrame to also verify that unpack_row_length_ and unpack_image_height_ are zero. Alternatively, ensure that ScopedUnpackParametersResetRestore is always enabled or correctly accounts for WebGL2-specific pixel storage parameters in its activation logic.

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 fast-path check for a default source rectangle ignored the WebGL2 UNPACK_ROW_LENGTH and UNPACK_IMAGE_HEIGHT parameters, and the scoped reset only ran when flip-Y or premultiply-alpha was set, so a stale row length survived into a tightly sized upload.

Impact

A page could reliably leak renderer heap memory, potentially recovering pointers to defeat ASLR, but it needs a Y16 video source such as a depth camera and the user's permission through getUserMedia.

What the attacker needed

A Y16 video source such as a depth camera; user grants camera permission; WebGL2 support in the browser

The fix

The default-rectangle check should also require unpack_row_length_ and unpack_image_height_ to be zero, or the scoped unpack reset should always run or account for WebGL2 pixel storage parameters.

How it was found

  1. Create a WebGL2 context.
  2. Get a Y16 video stream through getUserMedia.
  3. Set UNPACK_ROW_LENGTH to the video width plus an offset.
  4. Leave UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL at their false defaults.
  5. Upload the video element with texSubImage2D.
  6. Read the texture back with readPixels to obtain the leaked bytes.

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 web page sends video frames to the graphics card, it can set options that describe how the image data is laid out in memory, such as how many bytes make up one row. Here one of those options was left over from an earlier call and not cleared, so the browser copied more bytes per row than the buffer actually held, pulling in unrelated memory. The page could then read that memory back out of the image, which is a way to spy on data the browser was holding.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.