Integer overflow in ANGLE (CVE-2026-9882)
An integer overflow in ANGLE's IndexRange constructor can make a full 32-bit index range appear empty, bypassing software robust-buffer-access validation. On backends without hardware robust access (such as Metal), this could allow out-of-bounds GPU memory reads that an attacker-controlled vertex shader could exfiltrate via readPixels, potentially disclosing cross-origin GPU memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 33 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 Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: An integer overflow in ANGLE's IndexRange constructor can potentially cause 32-bit index ranges to bypass software robust-buffer-access validation. This could enable out-of-bounds GPU memory reads on backends lacking hardware robust access support, such as Metal on macOS.
Affected files:
third_party/angle/src/common/mathutil.hthird_party/angle/src/libANGLE/validationES.hthird_party/angle/src/common/utilities.cppthird_party/angle/src/libANGLE/Context.cppthird_party/angle/src/libANGLE/renderer/metal/DisplayMtl.mm
Estimated timestamp from git blame: 2025-04-11
Root Cause
A potential integer overflow vulnerability exists in the IndexRange constructor within third_party/angle/src/common/mathutil.h. The constructor computes the number of elements in a range using 32-bit unsigned arithmetic without overflow protection:
// third_party/angle/src/common/mathutil.h
IndexRange(uint32_t start_, uint32_t end_) : mStart(start_), mCount(end_ - start_ + 1)
{
ASSERT(start_ <= end_);
}
bool isEmpty() const { return mCount == 0; }
If the constructor is invoked with a range where start_ = 0 and end_ = 0xFFFFFFFF, the ASSERT passes, but the calculation 0xFFFFFFFF - 0 + 1 overflows the uint32_t capacity and wraps around to 0. This causes isEmpty() to return true for a range that actually encompasses all possible 32-bit indices.
Validation Bypass
This poisoned IndexRange can be produced when ANGLE scans an index buffer containing both 0 and 0xFFFFFFFF to determine bounds (via gl::ComputeIndexRange).
In the draw validation path, ANGLE implements software-based robust-access checking for backends that lack hardware support (such as Metal, where robustBufferAccessBehaviorKHR is false). This check is gated on the index range not being empty:
// third_party/angle/src/libANGLE/validationES.h:1115
// No op if there are no real indices in the index data (all are primitive restart).
if (!indexRange.isEmpty())
{
// ...
if (!ValidateDrawAttribs(context, entryPoint, static_cast<GLint>(indexRange.end())))
{
return false;
}
}
Because isEmpty() incorrectly returns true due to the overflow, the entire validation block—including index clamping and attribute bounds checking in ValidateDrawAttribs—is skipped. ValidateDrawElementsCommon subsequently returns true, permitting the draw call to proceed with unvalidated indices.
Applicability and Impact
In WebGL 1, primitive restart is disabled by default. If the OES_element_index_uint extension is enabled, an attacker can provide a GL_UNSIGNED_INT element buffer containing indices like [0, K, 0xFFFFFFFF]. This triggers the overflow, bypasses validation, and results in the GPU executing a draw call with an attacker-controlled out-of-bounds index K relative to the vertex buffer.
The fetched out-of-bounds data can be processed by an attacker-controlled vertex shader and exfiltrated via gl.readPixels(). Because the GPU process is shared across origins, this enables the potential disclosure of cross-origin GPU memory, such as data from other tabs or WebGL resources.
Potential Reproduction Steps (Theoretical)
Note: These are suggested steps; we have not yet verified them with a working Proof of Concept.
- On macOS Chrome (Metal backend), create a WebGL 1 context and enable
OES_element_index_uint. - Bind a small
ARRAY_BUFFERto a vertex attribute. - Bind an
ELEMENT_ARRAY_BUFFERpopulated with aUint32Array([0, K, 0xFFFFFFFF])whereKis a very large out-of-bounds index. - Call
gl.drawElements(gl.POINTS, 3, gl.UNSIGNED_INT, 0). - Observe that ANGLE validation passes due to the
IndexRangeoverflow, submitting the draw call to the GPU with OOB indices.
Suggested Fix
Modify the IndexRange constructor in third_party/angle/src/common/mathutil.h to use 64-bit arithmetic or a safe math wrapper (like base::CheckedNumeric) when calculating mCount to prevent the overflow. If the element count exceeds the 32-bit limit, the logic should safely handle the maximum range without wrapping to 0.
Evaluated with Chrome root at commit: a1e33f5848218e21d4a16ae2c1bc94e815c30c7f
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.
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 IndexRange constructor computes the element count as end - start + 1 in 32-bit unsigned arithmetic, so a range from 0 to 0xFFFFFFFF wraps to 0 and isEmpty() returns true.
Impact
On backends lacking hardware robust access, such as Metal on macOS, this could enable out-of-bounds GPU memory reads and potential disclosure of cross-origin GPU memory; the report notes the reproduction steps are theoretical and unverified.
What the attacker needed
MacOS Chrome with Metal backend; WebGL 1 context; OES_element_index_uint enabled; attacker-controlled vertex shader
The fix
The IndexRange constructor should use 64-bit arithmetic or a checked-math wrapper when computing the element count so the range cannot wrap to zero.
How it was found
- On macOS Chrome with the Metal backend, create a WebGL 1 context and enable the OES_element_index_uint extension.
- Bind a small ARRAY_BUFFER to a vertex attribute.
- Bind an ELEMENT_ARRAY_BUFFER containing a Uint32Array with values 0, a large out-of-bounds index K, and 0xFFFFFFFF.
- Call gl.drawElements with POINTS, count 3, UNSIGNED_INT and offset 0.
- Observe that ANGLE validation passes because the IndexRange overflow makes the range appear empty, and the draw is submitted with out-of-bounds indices.
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 lets web pages draw 3D graphics using the GPU. ANGLE is the part of Chrome that translates WebGL commands into the GPU's own language. A counting mistake in ANGLE can make a check that is supposed to stop a draw call from reading outside a buffer think there is nothing to check, so the GPU may read memory it should not, and a malicious page could try to read that memory back.
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.