Skip to content
Memory corruption Advisory Advanced CVE-2026-8554

Type Confusion in ANGLE (CVE-2026-8554)

ANGLE's shader translator fails to reject an array redeclaration of the built-in gl_LastFragDepthARM, causing type confusion in the AST during framebuffer fetch emulation. This leads to structurally invalid SPIR-V being passed to the Vulkan driver, potentially causing memory corruption and a GPU process sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 40 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 vulnerability in ANGLE allows a malicious renderer to submit GLSL that redeclares gl_LastFragDepthARM as an array, bypassing necessary type checks. During the framebuffer fetch emulation pass, this causes type confusion in the AST, resulting in the generation of structurally invalid SPIR-V. This malformed SPIR-V is passed directly to the Vulkan driver without validation, potentially triggering memory corruption and a GPU process sandbox escape.

Affected files:

  • third_party/angle/src/compiler/translator/ParseContext.cpp
  • third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.cpp
  • third_party/angle/src/compiler/translator/tree_util/ReplaceVariable.cpp
  • third_party/angle/src/compiler/translator/IntermNode.cpp
  • third_party/angle/src/compiler/translator/spirv/OutputSPIRV.cpp

Estimated timestamp from git blame: 2025-09-17

Overview

There is a potential type confusion vulnerability in ANGLE's shader translator when generating SPIR-V for Vulkan backends. By explicitly requesting the GL_ARM_shader_framebuffer_fetch_depth_stencil extension, an attacker can redeclare specific built-in variables (like gl_LastFragDepthARM) as arrays. This bypasses validation and corrupts the Abstract Syntax Tree (AST) during emulation passes, causing the compiler to emit structurally invalid SPIR-V.

Because SPIR-V validation is disabled in Chromium release builds, this malformed shader is passed directly to the proprietary Vulkan driver. Compiling structurally invalid SPIR-V can cause memory corruption within the driver, leading to a potential GPU process sandbox escape.

Note: The steps and exploitation path outlined below are based on detailed code analysis. A working proof-of-concept has not been actively run to verify the specific driver behavior.

Root Cause & Vulnerability Flow

1. Missing Type Validation: In third_party/angle/src/compiler/translator/ParseContext.cpp, the function TParseContext::declareVariable handles the redeclaration of built-in variables. For gl_FragDepth, the code explicitly checks if (type->isArray()) and throws an error. However, for the ARM framebuffer fetch built-ins like gl_LastFragDepthARM (handled around line 2007), this array check is completely missing.

2. AST Type Confusion: If an attacker provides GLSL such as:

GLSL
#extension GL_ARM_shader_framebuffer_fetch_depth_stencil : enable
highp float gl_LastFragDepthARM[10];
float f = gl_LastFragDepthARM[5];

The parser accepts the array and constructs a TIntermBinary node (EOpIndexDirect) representing the indexing operation. The type of this node is correctly inferred as a scalar float.

During the EmulateFramebufferFetch pass, the compiler replaces the array symbol gl_LastFragDepthARM with a scalar swizzle of a subpass load (e.g., subpassLoad(depth).x). The ReplaceVariables utility swaps the child node but does not recalculate the type of the parent TIntermBinary node. The AST is now in an invalid state: a TIntermBinary node is attempting to perform an array index operation on a child that is now a scalar float.

3. Malformed SPIR-V Generation: When OutputSPIRVTraverser processes this malformed AST:

  • visitSwizzle sees the .x component and appends index 0 to the current access chain's idList.
  • visitBinary processes the direct index (5) and appends it to the same idList, resulting in [0, 5].
  • The traverser calls accessChainOnPush, which contains a debug-only ASSERT(parentType.isVector()). Since the parent is a scalar, this assertion fails in debug builds, but in release builds, it is compiled out and execution continues blindly.
  • Finally, accessChainLoad emits an OpCompositeExtract instruction with a vec4 base (from the subpassLoad) and the indices [0, 5].

This is a violation of the SPIR-V specification. The first index (0) extracts a scalar float from the vec4, but the second index (5) illegally attempts to extract an element from that scalar.

Impact

In release builds, ANGLE skips running spvValidate before sending the SPIR-V to the driver via vkCreateShaderModule. Proprietary Vulkan driver compilers typically assume SPIR-V is structurally valid. Processing an OpCompositeExtract that indexes beyond the composite type's depth and into scalars can cause the driver compiler to perform out-of-bounds reads or writes against its internal AST/IR buffers. This leads to memory corruption inside the privileged GPU process.

Suggested Attacker Steps (Potential)

  1. Compromise Renderer: Gain arbitrary code execution within the unprivileged renderer process.
  2. Create Context: Communicate with the GPU process via IPC to create a GLES context using the passthrough command decoder (which passes GLSL directly to ANGLE without strict pre-validation).
  3. Submit Payload: Submit the malicious GLSL shader that enables the target extension and redeclares gl_LastFragDepthARM as an array, performing out-of-bounds indexing.
  4. Trigger Driver Bug: The renderer triggers a draw call or shader compilation, forcing the Vulkan driver to process the malformed SPIR-V, potentially triggering memory corruption and a sandbox escape into the GPU process.

Suggested Fix

In third_party/angle/src/compiler/translator/ParseContext.cpp, update TParseContext::declareVariable to enforce type constraints on ARM framebuffer fetch built-ins. Specifically, reject the redeclaration if the variable is an array or if the basic type does not match the expected scalar/vector type, mirroring the existing logic for variables like gl_FragDepth.

C++
// In TParseContext::declareVariable, around the ARM built-ins block:
if (type->isArray())
{
    error(line, "built-in variable cannot be redeclared as an array", identifier);
    return false;
}

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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 missing array type check for ARM framebuffer fetch built-ins in TParseContext::declareVariable, combined with the emulation pass not recalculating parent node types after replacing a variable.

Impact

In release builds, the malformed SPIR-V is passed to the Vulkan driver without validation, potentially causing memory corruption and a GPU process sandbox escape.

What the attacker needed

Compromised renderer process; ability to send IPC to GPU process; Vulkan driver with no SPIR-V validation

The fix

The fix should add an array type check for ARM framebuffer fetch built-ins in TParseContext::declareVariable, mirroring the existing check for gl_FragDepth.

How it was found

  1. Compromise the renderer process to gain code execution.
  2. Create a GLES context using the passthrough command decoder via IPC to the GPU process.
  3. Submit a GLSL shader that enables the extension and redeclares gl_LastFragDepthARM as an array with out-of-bounds indexing.
  4. Trigger a draw call or shader compilation to force the Vulkan driver to process the malformed SPIR-V.

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 shader code for graphics. A shader can declare a built-in variable as an array when it should not be allowed, confusing the translator and producing invalid instructions for the graphics driver. This could crash or corrupt the driver, potentially letting an attacker escape the GPU sandbox.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.