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

Out of bounds write in ANGLE (CVE-2026-16413)

A validation flaw in ANGLE's fragment shader output variable linking lets a shader output array exceed the maximum draw buffers limit when per-element bindings are used. This can cause out-of-bounds heap and stack writes in the Vulkan pipeline cache warm-up path, potentially allowing arbitrary code execution in the GPU process from a compromised renderer.

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

Overview: A potential validation logic error in ANGLE's fragment shader output variable linking allows output arrays to exceed the maximum draw buffers limit. When certain per-element bindings are used, this bypasses validation and triggers out-of-bounds stack and heap writes in the Vulkan pipeline cache warm-up path. This could potentially allow arbitrary code execution in the GPU process from a compromised renderer.

Affected files:

  • third_party/angle/src/libANGLE/ProgramExecutable.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp
  • third_party/angle/src/libANGLE/Program.h
  • third_party/angle/src/libANGLE/renderer/vulkan/vk_cache_utils.h
  • third_party/angle/src/common/FixedVector.h

Estimated timestamp from git blame: 2021-10-28

Summary

A potential logic flaw in ANGLE's output variable validation allows a fragment shader output array to span past IMPLEMENTATION_MAX_DRAW_BUFFERS (which is 8) when per-element API bindings are used via glBindFragDataLocationEXT. This validation bypass subsequently triggers out-of-bounds (OOB) writes on both the heap and stack within the Vulkan backend during pipeline cache warm-up, presenting a potential path to arbitrary code execution (RCE) in the GPU process.

Vulnerability Analysis

In ProgramExecutable::linkValidateOutputVariables (third_party/angle/src/libANGLE/ProgramExecutable.cpp), ANGLE processes per-element API bindings of the form name[k] (where k >= 1). It records VariableLocation(arrayIndex=k, varIdx) in reservedLocations and validates that they are under maxDrawBuffers. The base location is then assigned, and a guard calls FindUsedOutputLocation(outputLocations, maxLocation, baseLocation + elementCount - maxLocation, reservedLocations, idx) to detect if any indices exceed maxLocation.

There are two potential bypasses for this validation:

  1. Bypass A (Aliasing in FindUsedOutputLocation): Within FindUsedOutputLocation, a query VariableLocation(elementIndex, variableIndex) is constructed, where elementIndex is calculated as the offset from the passed baseLocation parameter (which is maxLocation when called by the over-max guard). However, VariableLocation::operator== (third_party/angle/src/libANGLE/Program.h) only compares {arrayIndex, index}. Thus, if an attacker has reserved a location for name[L - maxLocation] (registering a VariableLocation with arrayIndex = L - maxLocation), a query checking a truly used slot at location L will incorrectly match this reserved location. The guard is misled into treating a used slot as reserved, causing it to return false and allowing the link to succeed.

  2. Bypass B (Redirected Elements): If the attacker binds all array elements except element 0 to low, valid locations, then no slots at or above maxLocation are occupied in outputLocations. Consequently, the guard legitimately passes. However, downstream code in gatherOutputTypes and the Vulkan/Metal backends computes location contiguously as pod.location + elementIndex for all elements, completely ignoring the per-element redirects. With maxDrawBuffers = 8 and an array size of 8, the contiguous locations reach up to index 14 (i.e., 7 + 8 - 1).

Downstream Impact (Vulkan Backend)

When linking a program with the Vulkan backend feature warmUpPipelineCacheAtLink enabled, ANGLE calls SetupDefaultPipelineState in ProgramExecutableVk.cpp. This triggers potential memory corruption:

  1. Intra-object Heap/Stack Overflow: The loop over arrayIndex (0 to 7) calls setRenderPassColorAttachmentFormat(pod.location + arrayIndex, ...) which invokes RenderPassDesc::packColorAttachment in vk_cache_utils.cpp. This writes to mAttachmentFormats on a std::array<uint8_t, 9>. For indexes 9 to 14, this results in an intra-object overflow past the array boundary into adjacent fields of mWarmUpGraphicsPipelineDesc, while setting mColorAttachmentRange to 15.

  2. Stack Buffer Overflow in MakeRenderPass: When !preferDynamicRendering is true, RenderPassCache::MakeRenderPass loops up to colorAttachmentRange (15). Since the OOB-written formats at indices 9..14 are non-zero, isColorAttachmentEnabled returns true, causing colorAttachmentRefs.push_back(...) to execute 15 times on a stack-allocated FixedVector<VkAttachmentReference2, 8>. Because FixedVector::push_back lacks runtime bounds checks in release builds, this overwrites 7 elements (~224 bytes) of stack data with VkAttachmentReference2 structures.

Suggested / Potential Reproduction Steps

Note: These are potential steps as our tooling does not have the ability to execute code.

  1. Establish a compromised renderer process driving the passthrough GLES2 decoder with an ANGLE ES3 context supporting EXT_blend_func_extended and a Vulkan backend with warmUpPipelineCacheAtLink enabled.

  2. Create a GL program p, attach a vertex shader and a fragment shader containing:

    GLSL
    #version 300 es
    precision mediump float;
    out vec4 fragData[8];
    void main() {
        for(int i = 0; i < 8; ++i) fragData[i] = vec4(1);
    }
    
  3. Issue the following explicit GLES2 command buffer bindings:

    BindFragDataLocationEXTBucket(p, 7, "fragData");
    BindFragDataLocationEXTBucket(p, 0, "fragData[1]");
    BindFragDataLocationEXTBucket(p, 1, "fragData[2]");
    BindFragDataLocationEXTBucket(p, 2, "fragData[3]");
    BindFragDataLocationEXTBucket(p, 3, "fragData[4]");
    BindFragDataLocationEXTBucket(p, 4, "fragData[5]");
    BindFragDataLocationEXTBucket(p, 5, "fragData[6]");
    BindFragDataLocationEXTBucket(p, 6, "fragData[7]");
    
  4. Trigger the Vulkan OOB write by calling LinkProgram(p) on the program.

Suggested Fix

  1. Modify FindUsedOutputLocation so that it uses the correct corresponding array index offset when constructing VariableLocation for verification, or enforce strict bounds checks on the total potential location span (baseLocation + elementCount) directly against maxDrawBuffers regardless of explicit bindings during the initial link validation stage.
  2. Add hardening checks in RenderPassDesc::packColorAttachment to explicitly drop or error on any attachment indices exceeding kMaxFramebufferNonResolveAttachments instead of relying on debug-only ASSERT statements.

Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8


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 the reserved-location comparison ignores the base offset, and downstream code computes locations contiguously while ignoring per-element redirects, so the bounds guard is bypassed.

Impact

This could potentially allow arbitrary code execution in the GPU process, though only from an already compromised renderer and only when the Vulkan backend with pipeline cache warm-up is in use.

What the attacker needed

Compromised renderer process; ANGLE ES3 context with EXT_blend_func_extended; Vulkan backend; warmUpPipelineCacheAtLink enabled

The fix

The validation should use the correct array index offset and enforce strict bounds on the total location span, with hardening checks in the attachment packing code; the text does not say it was fixed.

How it was found

  1. Set up a compromised renderer with the passthrough GLES2 decoder, an ANGLE ES3 context supporting EXT_blend_func_extended, and a Vulkan backend with warmUpPipelineCacheAtLink enabled.
  2. Create a program with a fragment shader declaring an output array of eight vec4 elements.
  3. Bind the array base to a high location and each remaining element to low locations via the per-element bind commands.
  4. Link the program to trigger the out-of-bounds write in the Vulkan path.

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 the layer that translates web graphics calls into the graphics driver's own language. A check meant to stop a shader from writing to more output slots than exist could be fooled, so the program writes past the end of a fixed-size list in memory, which can crash or corrupt the graphics process.

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.