Out of bounds memory access in ANGLE (CVE-2026-11191)
ANGLE's shader translator can emit malformed shaders with out-of-bounds array accesses when a fragment shader uses both GL_EXT_draw_buffers and GL_EXT_blend_func_extended, because the gl_FragData array is resized without re-validating existing constant indices. The resulting invalid SPIR-V is passed to the native GPU driver, potentially causing memory corruption in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 48 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: ANGLE's shader translator can emit structurally malformed shaders with out-of-bounds array accesses when a fragment shader uses both GL_EXT_draw_buffers and GL_EXT_blend_func_extended. This occurs because the gl_FragData array is resized to a smaller value during AST transformation without re-validating or clamping existing constant indices. The resulting malformed shader code is passed to the native GPU driver, potentially causing memory corruption in the GPU process during shader compilation.
Affected files:
third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateFragColorData.cppthird_party/angle/src/compiler/translator/spirv/TranslatorSPIRV.cppthird_party/angle/src/compiler/translator/glsl/TranslatorGLSL.cppthird_party/angle/src/compiler/translator/msl/TranslatorMSL.cppthird_party/angle/src/compiler/translator/ValidateAST.cppthird_party/angle/src/compiler/translator/ParseContext.cpp
Estimated timestamp from git blame: 2023-07-17
Vulnerability Details
A logic error exists in ANGLE's shader translation process that allows the generation of structurally malformed backend shaders (such as SPIR-V) containing out-of-bounds array accesses.
This issue manifests through the following sequence of events:
- Initial Parsing: A WebGL fragment shader accesses a high valid index of
gl_FragData, such asgl_FragData[7]. InParseContext.cpp, this is validated againstMaxDrawBuffers(typically 8). Since7 < 8, the bounds check passes, and anEOpIndexDirectAST node is created with the constant literal index7. - Array Resizing: If the shader also uses
gl_SecondaryFragDataEXT(provided byGL_EXT_blend_func_extended), theEmulateFragColorDatatransformation pass is triggered during compilation. - Size Reduction:
EmulateFragColorDataTraverser::visitSymbolreplacesgl_FragDatawith a new internal array and resizes it toMaxDualSourceDrawBuffers. On most hardware, this limits the array size to1. - Missing Re-validation: The transformation does not traverse the parent tree to clamp or re-evaluate existing
EOpIndexDirectnodes.ValidateASTalso lacks bounds-checking for constant indices. Thus, an index of7pointing into an array of size1remains in the AST. - Malformed Output Emission: During SPIR-V generation (
OutputSPIRV.cpp), the literal index7is extracted from theEOpIndexDirectnode and directly emitted into anOpAccessChaininstruction without further bounds checking. - Validation Bypass: In Chromium Release builds,
ANGLE_ENABLE_ASSERTSis false, meaning ANGLE's internalspirv-valvalidation step is skipped for performance reasons.
The resulting structurally invalid SPIR-V is passed directly to the native Vulkan GPU driver via vkCreateShaderModule. Native drivers typically assume SPIR-V from trusted environments is structurally valid. Processing an out-of-bounds OpAccessChain leads to undefined behavior within the driver's shader compiler, frequently resulting in out-of-bounds memory reads or writes in the GPU process.
Impact
Compromising the GPU process allows an attacker to bypass the renderer sandbox on Desktop platforms (Windows, macOS, Linux). On Android, the GPU process is unsandboxed by default, meaning this could lead directly to arbitrary code execution on the host device.
Potential Reproduction Steps
Note: These are suggested steps to trigger the bug. We have not executed a full working proof-of-concept against a live driver.
-
Initialize a WebGL context.
-
Enable the required extensions in JavaScript:
JavaScript gl.getExtension('WEBGL_draw_buffers'); gl.getExtension('WEBGL_blend_func_extended'); -
Compile a fragment shader that writes to both extensions:
GLSL #extension GL_EXT_draw_buffers : require #extension GL_EXT_blend_func_extended : require precision mediump float; void main() { // Passes ParseContext validation (7 < MaxDrawBuffers) gl_FragData[7] = vec4(1.0); // Triggers EmulateFragColorData, reducing gl_FragData size to 1 gl_SecondaryFragDataEXT[0] = vec4(0.0); } -
Bind the shader and issue a draw call. On a Vulkan backend, ANGLE will submit the malformed SPIR-V to the driver.
Suggested Fix
The AST needs to remain consistent after the EmulateFragColorData transformation. We suggest updating EmulateFragColorData so that when gl_FragData is resized, the compiler traverses the AST to identify EOpIndexDirect nodes associated with this variable. Any indices that now exceed the new array size (MaxDualSourceDrawBuffers) should be clamped to MaxDualSourceDrawBuffers - 1, or alternatively, the compilation should be explicitly failed with an out-of-range error at the transformation stage.
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 EmulateFragColorData transformation resizes the gl_FragData array without re-validating or clamping existing constant index nodes, and ValidateAST lacks bounds-checking for constant indices.
Impact
Compromising the GPU process could bypass the renderer sandbox on desktop platforms and may lead directly to arbitrary code execution on Android, where the GPU process is unsandboxed by default.
What the attacker needed
WebGL context; WEBGL_draw_buffers extension; WEBGL_blend_func_extended extension; Vulkan backend
The fix
The EmulateFragColorData transformation should clamp out-of-range constant indices to the new array size or explicitly fail compilation with an out-of-range error.
How it was found
- Initialize a WebGL context.
- Enable the WEBGL_draw_buffers and WEBGL_blend_func_extended extensions in JavaScript.
- Compile a fragment shader that writes to gl_FragData[7] and gl_SecondaryFragDataEXT[0].
- Bind the shader and issue a draw call so ANGLE submits the malformed SPIR-V to the driver on a Vulkan backend.
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.
A shader is a small program that runs on the graphics card. ANGLE is a translator that converts WebGL shaders into a form the graphics driver can understand. A bug in this translation lets a shader refer to an array element that no longer exists, and the graphics driver may then read or write memory it should not, which can crash or compromise the process that talks to the GPU.
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.