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

Out of bounds read in ANGLE (CVE-2026-10930)

A logic error in ANGLE's Metal backend allows different WebGL programs to share a cached uniform buffer conversion without accounting for the Metal-specific layout size, leading to out-of-bounds offset calculations. An attacker could potentially read cross-origin GPU memory by crafting shaders that exploit this cache confusion.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 57 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 without the security team.

Overview: A logic error in ANGLE's Metal backend allows different WebGL programs to erroneously share a cached Uniform Buffer Object (UBO) conversion. The cache key fails to include the Metal-specific layout size, causing out-of-bounds offset calculations when a program with a larger layout reuses a buffer allocated for a smaller one. This could potentially allow an attacker to read cross-origin GPU memory using a malicious shader.

Affected files:

  • third_party/angle/src/libANGLE/renderer/metal/BufferMtl.mm
  • third_party/angle/src/libANGLE/renderer/metal/ProgramExecutableMtl.mm

Estimated timestamp from git blame: 2023-11-06

Summary

A potential out-of-bounds (OOB) GPU memory read exists in ANGLE's Metal backend. The vulnerability stems from a cache confusion flaw in BufferMtl::getUniformConversionBuffer, where converted Uniform Buffer Objects (UBOs) are cached without accounting for their Metal-specific layout sizes (metalSize). This allows an attacker to trick the backend into using an undersized MTLBuffer with an out-of-bounds offset, potentially leaking cross-origin textures or other sensitive data from the GPU heap.

Root Cause Analysis

When a GLSL uniform block requires layout conversion for Metal (e.g., due to matrix padding or std140 rules), the result is stored in a dynamic buffer pool. The cache key used to reuse these buffers is comprised of only the bufferIndex, srcOffset, and the standard GLSL layout size (stdSize).

Crucially, the key omits metalSize, which can vary significantly for the same stdSize. For example, a vec3 takes 12 bytes in std140 (allowing subsequent scalars to pack tightly) but requires a full 16 bytes in Metal. This allows different uniform structures to have the same stdSize but drastically different metalSizes.

If a program with a large metalSize reuses a cached buffer generated by a program with a small metalSize, ProgramExecutableMtl::legalizeUniformBufferOffsets skips conversion and calculates a physical offset into the cached buffer:

C++
size_t bytesToOffset = numBlocksToOffset * conversionInfo.metalSize();

Because metalSize is much larger than what the cached buffer was allocated for, bytesToOffset points out-of-bounds. An ASSERT macro designed to catch this bounds violation is compiled out in Chrome's Release builds. The out-of-bounds offset is passed directly to the Metal API ([MTLRenderCommandEncoder setVertexBuffer:offset:atIndex:]), which lacks runtime bounds checking in production, leading to out-of-bounds reads during shader execution.

Potential Reproduction Steps

Note: These are suggested steps based on code analysis, as our tooling agent cannot execute a live proof-of-concept.

  1. An attacker creates a WebGL 2 context on macOS (defaulting to the Metal backend).
  2. The attacker compiles Program A with a uniform block requiring conversion (e.g., containing layout(row_major) mat4), where stdSize matches its metalSize (e.g., 256 bytes).
  3. The attacker compiles Program B with a uniform block where stdSize is also 256 bytes, but metalSize is much larger (e.g., 512 bytes due to vec3 packing differences).
  4. The attacker allocates a large WebGL buffer and binds it using gl.bindBufferRange(..., offset=0).
  5. They execute a draw call with Program A. This allocates and populates a conversion buffer sized for metalSize = 256.
  6. The attacker binds the same WebGL buffer at a high offset (e.g., offset = max_size - 256) and executes a draw call with Program B.
  7. The cache matches on stdSize and offset alignment, improperly returning Program A's smaller buffer.
  8. The physical offset calculated for Program B uses its 512-byte metalSize, pushing the read pointer far past the end of the allocated MTLBuffer.
  9. The shader reads the leaked adjacent GPU heap memory, outputs it to the canvas, and the attacker retrieves it via gl.readPixels().

Suggested Fix

Update BufferMtl::getUniformConversionBuffer to include metalSize (and ideally, a hash of the full UBOConversionInfo layout or stdSize vs metalSize ratio) in its cache key criteria. This will ensure that uniform blocks with different Metal layouts cannot alias the same converted buffer.

Evaluated with Chrome root at commit: 137d451a126685dd5010e6609db9f6d4a78d8234


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 cache key for converted uniform buffers omits the Metal-specific layout size (metalSize), so buffers with the same standard size but different Metal sizes can alias, leading to out-of-bounds offsets.

Impact

This could potentially allow an attacker to read cross-origin GPU memory using a malicious shader.

What the attacker needed

MacOS with Metal backend; WebGL 2 support; ability to run shaders

The fix

Update BufferMtl::getUniformConversionBuffer to include metalSize in its cache key criteria.

How it was found

  1. Create a WebGL 2 context on macOS (Metal backend).
  2. Compile Program A with a uniform block where stdSize equals metalSize (e.g., 256 bytes).
  3. Compile Program B with a uniform block where stdSize is 256 bytes but metalSize is larger (e.g., 512 bytes).
  4. Allocate a large WebGL buffer and bind it at offset 0.
  5. Draw with Program A to populate a conversion buffer sized for metalSize 256.
  6. Bind the same buffer at a high offset and draw with Program B, causing an out-of-bounds read.

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.

WebGL programs use small memory buffers to pass data to the GPU. ANGLE, a translation layer, caches converted versions of these buffers to speed things up. A mistake in the cache key means a program expecting a larger buffer might reuse a smaller one, causing the GPU to read memory beyond the buffer's end. This could let an attacker see data from other programs on the same GPU.

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.