Out of bounds read in ANGLE (CVE-2026-13975)
A type mismatch in ANGLE's Metal backend causes signed baseVertex values to be zero-extended instead of sign-extended, leading to incorrect GPU memory offsets during vertex fetching. A compromised renderer could potentially perform out-of-bounds reads from GPU memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 46 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 type mismatch in ANGLE's Metal backend causes signed baseVertex values to be zero-extended when passed to the Metal API. This results in incorrect GPU memory offsets during vertex fetching, potentially allowing a compromised renderer to perform out-of-bounds reads from GPU memory.
Affected files:
third_party/angle/src/libANGLE/renderer/metal/mtl_command_buffer.mmthird_party/angle/src/libANGLE/renderer/metal/ContextMtl.mm
Estimated timestamp from git blame: Unknown (Google3 checkout)
Summary
A potential sign-extension vulnerability exists in ANGLE's Metal backend implementation of indexed draw calls. The baseVertex parameter, which is a signed integer in OpenGL ES and the Metal API, is incorrectly treated as an unsigned 32-bit integer within ANGLE's internal command stream. On 64-bit platforms, this causes negative baseVertex values to be zero-extended rather than sign-extended, leading to extremely large positive offsets during GPU vertex fetching.
Technical Details
The vulnerability exists in the transition between ANGLE's front-end and the Metal back-end encoder:
- Entry Point:
ContextMtl::drawElementsImplinthird_party/angle/src/libANGLE/renderer/metal/ContextMtl.mmreceives thebaseVertexparameter as a signedGLint(32-bit signed). - Type Mismatch: It calls
RenderCommandEncoder::drawIndexedInstancedBaseVertexBaseInstanceinthird_party/angle/src/libANGLE/renderer/metal/mtl_command_buffer.mm. The signature of this method (and its declaration inmtl_command_buffer.h) incorrectly definesbaseVertexas auint32_t(line 2202):C++ RenderCommandEncoder &RenderCommandEncoder::drawIndexedInstancedBaseVertexBaseInstance( ..., uint32_t baseVertex, ...) - Command Encoding: The signed value is implicitly cast to
uint32_tand pushed into theIntermediateCommandStream(line 2223). - API Invocation: During command execution,
DrawIndexedInstancedBaseVertexBaseInstanceCmdfetches the value as auint32_t(line 361) and passes it to the Metal API:OBJECTIVE-C [encoder drawIndexedPrimitives:primitiveType indexCount:indexCount indexType:indexType indexBuffer:indexBuffer indexBufferOffset:bufferOffset instanceCount:instances baseVertex:baseVertex // baseVertex is uint32_t here baseInstance:baseInstance];
On 64-bit macOS and iOS, the baseVertex parameter of drawIndexedPrimitives is an NSInteger (64-bit signed). When a uint32_t value like 0xFFFFFFFB (-5) is passed to a 64-bit NSInteger, it is zero-extended to 0x00000000FFFFFFFB (4,294,967,291) instead of being sign-extended to 0xFFFFFFFFFFFFFFFB (-5).
Impact
The GPU uses this zero-extended value to calculate vertex fetch addresses. For an index i, the effective index becomes i + 4,294,967,291. This causes the GPU to fetch vertex data from memory far beyond the bounds of the intended buffer (approximately 4GB offset).
Since the Metal backend advertises robustBufferAccessBehaviorKHR = false in DisplayMtl.mm (line 990), the driver is not required to clamp these accesses. This primitive could be used by a compromised renderer to disclose cross-origin GPU process memory.
Reachability
A compromised renderer can potentially trigger this path by enabling the GL_ANGLE_base_vertex_base_instance extension via the RequestExtensionCHROMIUM command. This extension is listed as requestable in the passthrough command decoder (gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc, line 278).
Suggested Potential Reproduction Steps
- From a compromised renderer (or with
--enable-webgl-draft-extensions), enable theGL_ANGLE_base_vertex_base_instanceextension usingglRequestExtensionCHROMIUM. - Create a small vertex buffer and bind it to an attribute.
- Create an index buffer with valid indices (e.g.,
[0, 1, 2]). - Issue a draw call with a negative
baseVertex:glDrawElementsInstancedBaseVertexBaseInstanceANGLE(..., -1, 0). - Observe that the GPU fetches vertices from an out-of-bounds offset (~4GB).
Proposed Fix
Change the baseVertex parameter type from uint32_t to int32_t (or GLint) in the following locations:
RenderCommandEncoder::drawIndexedInstancedBaseVertexBaseInstancesignature inmtl_command_buffer.handmtl_command_buffer.mm.- The
fetchandpushlogic inDrawIndexedInstancedBaseVertexBaseInstanceCmdand its corresponding encoder method inmtl_command_buffer.mm.
Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a
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
Likely the baseVertex parameter is declared as uint32_t instead of int32_t in the Metal command encoder, causing negative values to be zero-extended when passed to the Metal API.
Impact
A compromised renderer could potentially disclose cross-origin GPU process memory, as the Metal backend does not enforce robust buffer access.
What the attacker needed
Compromised renderer or WebGL draft extensions enabled
The fix
The baseVertex parameter type should be changed from uint32_t to int32_t in the relevant Metal command buffer methods.
How it was found
- Enable the GL_ANGLE_base_vertex_base_instance extension using glRequestExtensionCHROMIUM.
- Create a small vertex buffer and bind it to an attribute.
- Create an index buffer with valid indices.
- Issue a draw call with a negative baseVertex.
- Observe that the GPU fetches vertices from an out-of-bounds offset.
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.
In graphics programming, a 'baseVertex' is an offset added to indices when drawing. If it's negative, it should move backwards in memory. Here, a coding mistake treats it as a huge positive number instead, so the GPU reads from far outside the intended buffer. This could let an attacker who already controls the renderer process read sensitive data from GPU memory.
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.