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

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

A potential vulnerability in ANGLE's Metal backend allows a WebGL program to disclose GPU memory. During index buffer rewriting for primitive restarts with flat varyings, uninitialized buffer slots containing attacker-controlled stale data are bypassed by an early return and subsequently drawn due to a slicing logic error, leading to out-of-bounds reads into adjacent GPU memory.

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 security team.

Overview: A potential vulnerability in ANGLE's Metal backend allows a WebGL program to disclose GPU memory. During index buffer rewriting for primitive restarts with flat varyings, uninitialized buffer slots containing attacker-controlled stale data are bypassed by an early return and subsequently drawn due to a slicing logic error. Because Metal does not enforce vertex buffer bounds checking, these stale indices can cause out-of-bounds reads into adjacent GPU memory.

Affected files:

  • third_party/angle/src/libANGLE/renderer/metal/shaders/rewrite_indices.metal
  • third_party/angle/src/libANGLE/renderer/metal/ProvokingVertexHelper.mm
  • third_party/angle/src/libANGLE/renderer/metal/ContextMtl.mm
  • third_party/angle/src/libANGLE/renderer/metal/VertexArrayMtl.mm
  • third_party/angle/src/libANGLE/renderer/metal/mtl_buffer_pool.mm

Estimated timestamp from git blame: 2021-10-07

Overview

There is a potential information disclosure vulnerability in ANGLE's Metal backend. The issue occurs when WebGL2 applications use gl.drawElements with primitive restart enabled and flat varyings (which defaults to LastVertexConvention). To emulate this convention on Metal, ANGLE rewrites the index buffer. A combination of uninitialized memory reuse, an early return in the rewrite compute kernel, and a scaling bug in draw command generation allows an attacker to fetch out-of-bounds vertex attributes from the GPU heap.

Note: The following analysis and steps are potential, as our tooling agent does not currently have the capability to run code to produce a fully working proof-of-concept.

Technical Details

  1. Uninitialized Buffer Reuse: During index buffer rewriting, ProvokingVertexHelper::preconditionIndexBuffer sub-allocates memory for the new index buffer using mtl::BufferPool::allocate. When reusing previously freed buffers, this pool does not zero or clear the memory (third_party/angle/src/libANGLE/renderer/metal/mtl_buffer_pool.mm).
  2. Early Return in Compute Kernel: The index rewriting kernel fixIndexBuffer (third_party/angle/src/libANGLE/renderer/metal/shaders/rewrite_indices.metal) processes primitives. For TriangleStrip, if a thread encounters the primitive restart index, it hits an early return (rewrite_indices.metal:177-181) before writing anything to its assigned output slots. Consequently, these slots retain whatever stale data was previously in the BufferPool memory.
  3. Draw Command Slicing Bug: After rewriting, ContextMtl::drawElementsImpl calls VertexArrayMtl::getDrawIndices to split the draw around the restart indices. It passes the expanded, rewritten index count (a triangle strip scales up by ~3x when converted to a triangle list) but still relies on the restart offsets from the original, unscaled index buffer. getDrawIndices (VertexArrayMtl.mm:800-845) fails to account for this scaling factor, calculating incorrect slice boundaries that encompass the unwritten, stale slots in the rewritten buffer.
  4. Validation Bypass: The frontend CPU index validation (ComputeTypedIndexRange) correctly ignores the restart index. As long as the non-restart indices in the original buffer are within bounds, the draw call passes validation.
  5. Out-of-Bounds Fetch: In ANGLE's Metal backend, robustBufferAccessBehaviorKHR is explicitly set to false, and vertex attribute fetches rely on standard Metal [[attribute(n)]] qualifiers which lack implicit bounds checking. When the GPU executes the flawed draw commands, it reads the stale, attacker-controlled indices from the skipped slots, causing an out-of-bounds read into adjacent GPU memory.

Potential Steps to Trigger

An attacker could potentially exploit this by performing the following sequence from a malicious WebGL webpage:

  1. Prime the BufferPool: Issue a large, crafted draw call or buffer upload designed to allocate a dynamic buffer in the Metal backend and fill it with very large, specific integer values (designed to point out-of-bounds).
  2. Free the Memory: Allow the operation to complete, returning the memory to the BufferPool free list.
  3. Trigger the Bug: Enable gl.PRIMITIVE_RESTART_FIXED_INDEX, set up a shader program with flat varyings, and issue a gl.drawElements call using gl.TRIANGLE_STRIP where some indices are the primitive restart index (0xFFFFFFFF).
  4. Exfiltrate: The out-of-bounds data fetched by the GPU will be passed to the fragment shader via the flat varying. Render this data to a framebuffer and read it back to JavaScript using gl.readPixels().

Suggested Fix

  1. Fix Compute Kernel Output: Modify rewrite_indices.metal so that if foundRestart is true, instead of returning early and leaving memory uninitialized, the kernel writes degenerate indices (e.g., zeroes, or repeating the same valid index) into the output slots to ensure no stale data is left behind.
  2. Fix Draw Command Slicing: Correct the logic in VertexArrayMtl::getDrawIndices (or how ContextMtl calls it) to account for the topology scaling factor (e.g., $N$ to $3N-6$ for triangle strips) when calculating nIndicesInSlice and currentIndexOffset on a rewritten index buffer.
  3. Defense in Depth: Consider clearing or zeroing out memory retrieved from the free list in mtl::BufferPool::allocate if it is being used for operations that may perform sparse/partial writes.

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


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

Likely a combination of uninitialized memory reuse in a buffer pool, an early return in a compute kernel that leaves output slots unwritten, and a slicing logic error that fails to account for index buffer scaling, resulting in out-of-bounds reads.

Impact

A malicious web page could potentially read out-of-bounds GPU memory, leading to information disclosure.

What the attacker needed

Victim visits a malicious WebGL page; browser uses ANGLE with Metal backend; WebGL2 support

The fix

The compute kernel should write degenerate indices instead of returning early, the draw command slicing should account for topology scaling, and the buffer pool should zero memory on allocation.

How it was found

  1. Prime the BufferPool with large integer values via a crafted draw call or buffer upload.
  2. Free the memory, returning it to the BufferPool free list.
  3. Enable primitive restart, set up a shader with flat varyings, and issue a drawElements call with a triangle strip containing restart indices.
  4. Exfiltrate the out-of-bounds data by rendering to a framebuffer and reading it back with readPixels.

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 is a way for web pages to draw 3D graphics using the graphics card (GPU). ANGLE is a piece of software that translates WebGL commands so they work on different systems, including Apple's Metal. This report suggests that a bug in that translation could let a malicious web page read data from the GPU's memory that it should not be able to see, potentially leaking sensitive information.

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.