Out of bounds read in WebGL (CVE-2026-9943)
A logic error in the GLES2 validating command decoder's vertex attribute validation allows a renderer to over-count accessible vertex elements when the attribute stride is smaller than the element size, leading to out-of-bounds reads from GPU memory. An attacker could potentially leak cross-origin GPU data on Android where the GPU process is shared.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 42 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 go/chrome-ai-generated-security-bugs-faq for more information.
Overview: A logic error in VertexAttrib::CanAccess within the GLES2 validating command decoder allows WebGL on Android to over-count accessible vertex elements when attribute stride is smaller than attribute size. This can lead to out-of-bounds reads from GPU memory during draw calls. An attacker could potentially leak cross-origin GPU data on platforms where the GPU process is shared.
Affected files:
gpu/command_buffer/service/vertex_attrib_manager.ccgpu/command_buffer/service/gles2_cmd_decoder.cc
Estimated timestamp from git blame: 2016-02-26
Summary
A logic error in the GLES2 validating command decoder's vertex attribute validation allows a renderer to potentially trigger out-of-bounds reads from GPU memory. When a vertex attribute is configured with overlapping elements (a stride smaller than its total component size), the VertexAttrib::CanAccess function over-counts the number of elements that can safely be accessed within the buffer. This allows a compromised or malicious renderer to perform out-of-bounds reads of adjacent GPU memory during draw calls, leading to a potential cross-origin information leak on platforms where the validating decoder is still active (primarily Android).
Technical Details
In gpu/command_buffer/service/vertex_attrib_manager.cc, the VertexAttrib::CanAccess function validates if a specific vertex index is within the bounds of a bound buffer. The calculation is:
uint32_t usable_size = buffer_size - offset_;
GLuint num_elements = usable_size / real_stride_ +
((usable_size % real_stride_) >= (GLES2Util::GetGroupSizeForBufferType(size_, type_)) ? 1 : 0);
return index < num_elements;
This formula incorrectly assumes that the stride (real_stride_) is always greater than or equal to the attribute's element size (group_size).
The OpenGL ES specification allows a non-zero stride to be smaller than the element size, which creates overlapping attributes. When real_stride_ < group_size, the term usable_size % real_stride_ will mathematically always be strictly less than real_stride_, and consequently always less than group_size. This causes the second addition term to always evaluate to 0, simplifying the formula to floor(usable_size / real_stride_).
This is incorrect for overlapping attributes. The last valid index i must satisfy i * stride + group_size <= usable_size. The current logic validates an index i based purely on the start offset of the element (i * stride), without verifying that the entire footprint of that final element (i * stride + group_size) fits within the buffer.
Example Scenario:
Consider a buffer of 20 bytes, an attribute with a group size of 16 bytes (size=4, type=GL_FLOAT), and a stride of 4 bytes.
- Current logic:
num_elements = 20 / 4 + 0 = 5. It considers indices 0, 1, 2, 3, 4 to be valid. - Index 4 access: The driver will fetch 16 bytes starting at offset
4 * 4 = 16. The access range is[16, 32). - Result: Since the buffer size is only 20 bytes, this results in a 12-byte out-of-bounds read from GPU memory.
Furthermore, because the Validating Command Decoder does not explicitly request robust buffer access from the underlying ANGLE driver during initialization (relying instead on its own validation), ANGLE bypasses its internal bounds checks (ValidateDrawArraysAttribs). The driver executes the flawed draw call natively on the GPU hardware.
Impact
This issue is reachable via standard WebGL APIs from a renderer. The validating decoder is still compiled in and used by default on Android (ui/gl/features.gni:23). On Android, the GPU process is typically shared across all origins and is unsandboxed. An attacker could potentially exfiltrate the leaked bytes by passing the out-of-bounds attribute data through a vertex shader and observing the results via glReadPixels, leading to a High-severity cross-origin information leak (S1).
Potential Reproduction Steps
Please note: These are theoretical steps based on code analysis. We do not currently have a live proof-of-concept for this issue.
- Use an Android device where the validating command decoder is active.
- Create a WebGL context and a shader program that captures an attribute's value (e.g., writing it to
gl_FragColoror transform feedback). - Bind a small buffer (e.g., 20 bytes).
- Configure a vertex attribute with overlapping elements (e.g.,
size=4, type=gl.FLOAT, stride=4). - Perform a draw call (
gl.drawArrays) with a count that includes the over-counted index (e.g.,count=5). - Read back the rendered pixels to observe data fetched from adjacent memory beyond the buffer's boundaries.
Suggested Fix
The calculation for accessible elements in VertexAttrib::CanAccess should be updated to correctly handle overlapping attributes.
A robust calculation (similar to ANGLE's VertexAttribute::updateCachedElementLimit) would be:
uint32_t usable_size = buffer_size - offset_;
uint32_t group_size = GLES2Util::GetGroupSizeForBufferType(size_, type_);
if (usable_size < group_size) {
// Even the first element doesn't fit.
return false;
}
// Calculate remaining space after the first full element is accounted for
uint32_t remaining_space = usable_size - group_size;
GLuint num_elements = (remaining_space / real_stride_) + 1;
return index < num_elements;
Evaluated with Chrome root at commit: 661452647ddb2827305122ff3273bd5dea403f09
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 VertexAttrib::CanAccess function calculates the number of accessible elements using a formula that assumes the stride is at least as large as the element size, so when the stride is smaller, it over-counts and fails to check that the entire element fits within the buffer.
Impact
An attacker could potentially exfiltrate the leaked bytes via a vertex shader and glReadPixels, leading to a High-severity cross-origin information leak on Android where the GPU process is shared and unsandboxed.
What the attacker needed
Android device with validating decoder active; WebGL support; Malicious renderer
The fix
The calculation in VertexAttrib::CanAccess should be updated to correctly handle overlapping attributes by checking that the entire element fits within the buffer.
How it was found
- Use an Android device where the validating command decoder is active.
- Create a WebGL context and a shader program that captures an attribute's value.
- Bind a small buffer (e.g., 20 bytes).
- Configure a vertex attribute with overlapping elements (e.g., size=4, type=gl.FLOAT, stride=4).
- Perform a draw call with a count that includes the over-counted index (e.g., count=5).
- Read back the rendered pixels to observe data fetched from adjacent memory beyond the buffer's boundaries.
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. A validation function in Chrome's GPU process incorrectly calculates how many vertex elements fit in a buffer when the stride (the gap between elements) is smaller than the element size, allowing reads past the buffer's end. This could let a malicious page read data from other pages that share the same GPU process, mainly on Android.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.