Insufficient validation of untrusted input in ANGLE (CVE-2026-9969)
ANGLE's GLSL parser accepts global variables declared with only an interpolation qualifier, bypassing validation and generating malformed SPIR-V. This invalid SPIR-V is passed to the host Vulkan driver, potentially causing memory corruption in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 32 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: ANGLE's GLSL parser fails to reject global variables declared with only an interpolation qualifier (e.g., centroid). This bypasses semantic validation and generates malformed SPIR-V in release builds, which is passed to the host Vulkan driver and can potentially cause memory corruption in the GPU process.
Affected files:
third_party/angle/src/compiler/translator/spirv/OutputSPIRV.cppthird_party/angle/src/compiler/translator/QualifierTypes.cppthird_party/angle/src/compiler/translator/ParseContext.cppthird_party/angle/src/compiler/translator/util.cppthird_party/angle/src/libANGLE/renderer/vulkan/spv_utils.cpp
Estimated timestamp from git blame: 2024-05-28
Description
A potential vulnerability exists in ANGLE's GLSL frontend where it fails to properly validate and reject global variable declarations that use a bare interpolation or auxiliary qualifier (such as centroid, flat, or smooth) without a corresponding storage qualifier like in or out.
Root Cause Analysis
When parsing a declaration like centroid float bogus; at the global scope:
- Qualifier Merging (
QualifierTypes.cpp): The parser initially assigns a base scope qualifier ofEvqGlobal. During qualifier merging inJoinVariableStorageQualifier(lines 353-355), theEvqGlobalstate is directly overwritten by theEvqCentroidqualifier. - Validation Bypass (
ParseContext.cpp): The variable is declared with theEvqCentroidqualifier, which is marked as an "Incomplete" qualifier inBaseTypes.hbecause it lacks a direction (In/Out). Semantic checks likecheckVaryingLocationsrely on helpers likeIsVaryingIn()(inutil.cpp), which returnfalsefor incomplete qualifiers. Thus, the invalid variable silently bypasses structural validation and is added to the AST. - SPIR-V Generation (
OutputSPIRV.cpp): During SPIR-V generation,GetStorageClassattempts to resolve a SPIR-V storage class forEvqCentroid. Lacking a specificcase, it falls through to thedefault:branch. This branch contains an assertion (ASSERT(type.getInterfaceBlock() != nullptr || qualifier == EvqUniform);) that catches the error in debug builds. However, in official release builds (ANGLE_ENABLE_ASSERTSis undefined), the assertion is a no-op, and the function incorrectly returnsspv::StorageClassUniform. - Malformed SPIR-V: The variable is emitted with the
Uniformstorage class but, because its basic type isEbtFloatand notEbtInterfaceBlock, it is not decorated with the mandatoryBlockdecoration, directly violating Vulkan SPIR-V validation ruleVUID-StandaloneSpirv-Uniform-06807.
Impact
This vulnerability allows a malicious webpage (via WebGL or WebGPU) to provide structurally invalid SPIR-V to the host Vulkan driver via vkCreateShaderModule. Depending on the robustness of the vendor-specific Vulkan driver's shader compiler, processing this malformed input can potentially lead to out-of-bounds memory access or memory corruption. Because the Vulkan driver executes within Chrome's GPU process—which is unsandboxed on platforms like Android—this could lead to full remote code execution (RCE) and system compromise.
Potential Reproduction Steps
(Note: These are suggested steps to trigger the compilation bug; a full driver exploit requires a vulnerable vendor driver)
- Use a browser using ANGLE's Vulkan backend.
- Compile a vertex shader with a bare interpolation qualifier:
GLSL #version 300 es precision mediump float; centroid float bogus; void main() { gl_Position = vec4(bogus); } - Link the program. In a release build, the malformed SPIR-V is generated and passed to the Vulkan driver.
Suggested Fix
Update TParseContext::declareVariable or GetVariableTypeQualifierFromSortedSequence to explicitly reject global variable declarations that result in incomplete qualifiers (like EvqCentroid, EvqFlat, EvqSmooth) without a corresponding In or Out storage qualifier.
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
Likely the parser overwrites the global storage qualifier with an incomplete interpolation qualifier and later fails to handle it during SPIR-V generation, emitting an invalid storage class.
Impact
A malicious webpage could potentially cause out-of-bounds memory access or memory corruption in the GPU process, and on unsandboxed platforms like Android this could lead to remote code execution.
What the attacker needed
Browser with ANGLE Vulkan backend; victim visits malicious webpage; vulnerable vendor Vulkan driver
The fix
The parser should be updated to explicitly reject global variable declarations that result in incomplete qualifiers without a corresponding In or Out storage qualifier.
How it was found
- Use a browser using ANGLE's Vulkan backend.
- Compile a vertex shader with a bare interpolation qualifier.
- Link the program; in a release build, malformed SPIR-V is generated and passed to the Vulkan driver.
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.
ANGLE is a component that translates WebGL shader code into a form the graphics driver can understand. The parser did not properly check a certain kind of variable declaration, so it produced invalid instructions for the graphics driver. A malicious webpage could exploit this to crash or take over the graphics process, which on some systems has high privileges.
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.