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

Inappropriate implementation in ANGLE (CVE-2026-17677)

A logic error in ANGLE's SPIR-V translator used a break instead of continue when scanning shader input variables, so gl_FragCoord could be missed and given a generic ID. On Android with dithering emulation, this produced a SPIR-V module with duplicate FragCoord built-ins, which was passed to the unsandboxed GPU process driver and could lead to memory corruption and a sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 2 months

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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A logic error in ANGLE's SPIR-V translator causes it to prematurely terminate its scan of input variables, leading to incorrect SPIR-V metadata. On Android, this triggers the injection of duplicate built-in variables into the shader module, violating the Vulkan specification. Providing such malformed SPIR-V to production graphics drivers in the unsandboxed GPU process could lead to memory corruption and remote code execution.

Affected files:

  • third_party/angle/src/compiler/translator/spirv/TranslatorSPIRV.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/spv_utils.cpp
  • third_party/angle/src/compiler/translator/spirv/BuildSPIRV.cpp
  • third_party/angle/src/compiler/translator/spirv/OutputSPIRV.cpp

Estimated timestamp from git blame: Unknown (Google3 checkout)

Description

A logic error exists in ANGLE's TranslatorSPIRV::translateImpl within third_party/angle/src/compiler/translator/spirv/TranslatorSPIRV.cpp. When scanning the shader's input varyings to assign reserved SPIR-V IDs and set metadata flags, the implementation uses break instead of continue for several built-in variables. This causes the scanner to stop processing the remaining variables in the list if it encounters certain built-ins early.

Specifically, the loop at lines 878-921 handles built-ins like gl_SampleID, gl_PointCoord, and gl_FragCoord. If gl_SampleID or gl_PointCoord appears in the mInputVaryings list before gl_FragCoord, the scanner executes a break and never reaches the code that handles gl_FragCoord (lines 912-920).

Impact on SPIR-V Generation

When the scanner is cut short:

  1. assignSpirvId is not called for gl_FragCoord, meaning it is not mapped to its reserved SPIR-V ID (kIdFragCoord).
  2. The usesFragCoord flag remains false, preventing the metadata flag HasFragCoord from being set in mMetadataFlags (line 995).
  3. During SPIR-V emission in BuildSPIRV.cpp, gl_FragCoord is assigned a generic ID instead of the reserved one.
  4. Consequently, the kOverviewHasFragCoordMask bit in the non-semantic overview marker is not set.

On Android, when the emulateDithering feature is active, ANGLE's SpirvDitherEmulationTransformer (in third_party/angle/src/libANGLE/renderer/vulkan/spv_utils.cpp) inspects these flags. If hasFragCoord() returns false, the transformer proceeds to inject a second OpVariable decorated with BuiltIn FragCoord using the reserved ID. This results in a SPIR-V module with two distinct variables both decorated as the FragCoord built-in, violating Vulkan standalone SPIR-V requirements (VUID-StandaloneSpirv-OpEntryPoint-08721).

Security Impact

This malformed SPIR-V is passed directly to the production Vulkan driver's vkCreateShaderModule call. In Chrome on Android, the GPU process is currently unsandboxed. Driver shader compilers are highly complex and typically assume SPIR-V validity; providing a module that violates fundamental uniqueness constraints for built-in variables can lead to undefined behavior, including memory corruption (such as out-of-bounds writes or use-after-frees) within the driver's JIT compiler. This allows for a potential sandbox escape from a compromised renderer to the privileged GPU process.

Potential Reproduction Steps

Note: These are potential steps based on code analysis.

  1. From a web page, create a WebGL 2.0 context.

  2. Create a fragment shader that references gl_PointCoord before gl_FragCoord in its execution path (or simply by lexical order if the compiler preserves it). Example:

    GLSL
    #version 300 es
    precision mediump float;
    out vec4 color;
    void main() {
        float x = gl_PointCoord.x;
        color = vec4(gl_FragCoord.xyz, x);
    }
    
  3. Trigger a draw call using this shader on an Android device where dithering emulation is required (typically devices lacking hardware dithering support).

  4. The resulting invalid SPIR-V module will be submitted to the driver in the GPU process.

Suggested Fix

In third_party/angle/src/compiler/translator/spirv/TranslatorSPIRV.cpp, change the break statements to continue at lines 903, 909, and 919 within the mInputVaryings loop in TranslatorSPIRV::translateImpl.

Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

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 a logic error where the input-varying scan uses break instead of continue for certain built-ins, so gl_FragCoord is skipped and its metadata flag is never set.

Impact

Could lead to memory corruption in the driver's shader compiler and a potential sandbox escape from a compromised renderer to the privileged GPU process; the text notes the GPU process is currently unsandboxed on Android.

What the attacker needed

Android device needing dithering emulation; WebGL 2.0 context; Attacker controls shader content

The fix

The break statements in the input-varying loop should be changed to continue so all built-ins are scanned.

How it was found

  1. Create a WebGL 2.0 context from a web page.
  2. Create a fragment shader that references gl_PointCoord before gl_FragCoord.
  3. Trigger a draw call on an Android device where dithering emulation is required.
  4. The invalid SPIR-V module is submitted to the driver in the GPU process.

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.

Shaders are small programs that tell the graphics card how to draw things, and they are translated into an intermediate format before the driver compiles them. A scanning loop in the translator stopped early because of a wrong keyword, so one special variable was not recognised and a second copy of it was added. The graphics driver then received an invalid program, and because the graphics process on Android is not sandboxed, a bug in the driver could let an attacker escape the browser's protection.

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.