Out of bounds memory access in ANGLE (CVE-2026-9910)
A logic flaw in ANGLE's identifier renaming allows a name collision between two user variables when one is exactly 1022 characters and the other is exactly 1024 characters, because the prefixing step is skipped for the longer name. This collision subverts lexical scoping after ANGLE's AST-based bounds clamping, so the native OpenGL driver applies a large clamp range to a small inner array, potentially allowing out-of-bounds memory access in GPU shader-local storage.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 55 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 flaw in ANGLE's identifier renaming allows attackers to force name collisions in the generated GLSL by exploiting the 1024-character length limit. This collision subverts lexical scoping rules after ANGLE's AST-based bounds clamping has occurred. Consequently, the native OpenGL driver applies a large valid clamp range to a small inner array, allowing potential out-of-bounds memory access in GPU shader-local storage.
Affected files:
third_party/angle/src/compiler/translator/HashNames.cppthird_party/angle/src/compiler/translator/tree_ops/ClampIndirectIndices.cpp
Estimated timestamp from git blame: 2025-07-24
Root Cause Analysis
In ANGLE's third_party/angle/src/compiler/translator/HashNames.cpp, the HashName function is responsible for prefixing user-defined variables (typically with _u) to prevent collisions with built-in GLSL variables. However, if the HashFunction is nullptr (which is the default for the passthrough command decoder on the OpenGL backend), the function uses a length check to avoid generating identifiers longer than the GLSL spec limit of 1024 characters:
size_t kPrefixLength = 2;
if (!prefix || name.length() + kPrefixLength > kESSLMaxIdentifierLength)
{
return name; // Returns unmodified if prefixing exceeds 1024 characters
}
// Otherwise prepends '_' + prefix (e.g., '_u')
ImmutableString res = BuildConcatenatedImmutableString('_', prefix, name);
Because the preprocessor allows user tokens up to 1024 characters (kESSLMaxIdentifierLength), a collision can be engineered:
- A user variable named
X(exactly 1022 characters long) has_uprepended to it, yielding a 1024-character identifier_uX. - A second user variable explicitly named
_uX(exactly 1024 characters long) triggers the length limit and is returned unmodified as_uX.
Exploit Mechanism (Clamp Bypass)
This collision becomes a security vulnerability when combined with ANGLE's ClampIndirectIndices pass, which is enabled on the OpenGL backend. The clamping pass operates on the Abstract Syntax Tree (AST), where the two variables are still distinct symbols.
If an attacker declares the 1022-character variable as a large array in an outer scope, and the 1024-character variable as a small array in an inner scope, ANGLE's AST will correctly resolve an array access in the inner scope to the outer array. The compiler will insert a clamp() matching the outer array's large bounds.
However, when TOutputGLSLBase generates the final GLSL text, both variables share the exact same string name _uX. When the native OpenGL driver parses this emitted GLSL, standard lexical scoping causes the identifier to resolve to the inner (small) array, but it still retains the large clamp() range inserted by ANGLE.
Potential Attacker Steps
Note: These are suggested steps based on source code analysis, as our tooling agent cannot execute code to verify a live PoC.
- Craft the Shader: An attacker provides a WebGL2 fragment shader containing the following structure:
GLSL // 'X' is 1022 chars long float X[16384]; { // '_uX' is 1024 chars long, exactly matching the prefixed outer name float _uX[1]; // ANGLE clamps this based on the outer array: clamp(idx, 0, 16383) X[idx] = 1.0; } - Trigger the Collision: The passthrough command decoder sends this to ANGLE. ANGLE emits GLSL where both arrays are named
_uX(1024 chars long). The emitted assignment becomes_uX[clamp(idx, 0, 16383)] = 1.0;. - Achieve OOB Access: The native driver compiles the shader, linking the access to the 1-element array but allowing indices up to 16383.
- Exploit GPU State: The attacker sets the
idxuniform to a large value, achieving out-of-bounds reads/writes in the GPU's shader-local storage (scratch memory/registers). This can potentially be leveraged to leak cross-origin data from other contexts sharing the GPU or corrupt the GPU process.
Suggested Fix
The HashName logic should not silently return the original string if appending the prefix exceeds the maximum identifier length, as this breaks the guarantee that all user variables are safely prefixed.
If a user-defined identifier is so long that adding the _u prefix would exceed 1024 characters, the compiler should either:
- Treat it as a compilation error during the semantic analysis phase (e.g., rejecting identifiers longer than
1024 - kPrefixLength). - Use a guaranteed-safe fallback hashing mechanism that always generates a short, unique name regardless of the input length.
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.
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 HashName function returns the original identifier unmodified when adding the '_u' prefix would exceed the 1024-character GLSL limit, so a long user name can collide with a shorter name that was prefixed.
Impact
This could potentially allow out-of-bounds reads or writes in GPU shader-local storage, which may be leveraged to leak cross-origin data from other contexts sharing the GPU or corrupt the GPU process; the report notes the steps are suggested from source analysis and were not verified with a live proof of concept.
What the attacker needed
WebGL2 support; OpenGL backend with passthrough decoder; Attacker can supply a shader
The fix
The HashName logic should reject identifiers that would exceed the limit after prefixing, or use a guaranteed-safe fallback hashing mechanism that always generates a short, unique name.
How it was found
- Craft a WebGL2 fragment shader with a 1022-character outer array name and a 1024-character inner array name that matches the prefixed outer name.
- Send the shader through the passthrough command decoder so ANGLE emits GLSL where both arrays share the same 1024-character name.
- The native driver compiles the shader, linking the access to the small inner array but keeping the large clamp range from the outer array.
- Set the index uniform to a large value to achieve out-of-bounds reads or writes in GPU shader-local storage.
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 shaders are small programs that run on the graphics card. ANGLE is a translator that turns them into a form the graphics driver understands. This report says a naming mistake in that translator can make two different arrays look like the same name to the driver, so the driver may let a program read or write past the end of a small array.
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.