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

Out of bounds read in ANGLE (CVE-2026-87604)

ANGLE's Vulkan backend only used debug-only assertions to enforce that immutable sampler bindings have a descriptor count of one, so a compromised renderer could declare an array of external samplers and bind a YCbCr texture to the first element. This made the driver read past a host heap allocation and dereference the resulting bytes as sampler handles, potentially allowing a GPU process sandbox escape on Android.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 52 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: ANGLE's Vulkan backend relies on debug-only assertions to ensure immutable sampler bindings have a descriptor count of 1. A compromised renderer can declare an array of external samplers, causing a host-heap out-of-bounds read and driver-level wild pointer dereference during vkCreateDescriptorSetLayout. On Android, this potentially leads to a GPU process sandbox escape.

Affected files:

  • 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/renderer/vulkan/vk_cache_utils.h

Estimated timestamp from git blame: 2024-05-03

1. Summary of the Issue (Meant for Human Triage)

ANGLE's Vulkan backend relies exclusively on debug-only ASSERT() statements to enforce the assumption that immutable-sampler bindings have an array/descriptor size (descriptorCount) of exactly 1. When running release builds, there are no runtime checks to restrict or clamp this value when handling shader-declared arrays of external samplers.

A compromised renderer process (A-RENDERER) on Android can leverage this gap by compiling a shader that declares an array of external samplers (e.g., uniform samplerExternalOES vid[8];) and binding a YCbCr (such as an Android AHardwareBuffer-backed) texture to the first element (index 0). During the drawing sequence, ANGLE creates a pipeline layout where the DescriptorSetLayoutDesc has a descriptorCount of 8 but only writes a single VkSampler handle into mImmutableSamplers (an angle::FastVector<VkSampler, 1>).

When ANGLE unpacks the bindings to issue vkCreateDescriptorSetLayout, binding.pImmutableSamplers is configured to point into the mImmutableSamplers vector, but binding.descriptorCount remains 8. This directly violates Vulkan Specification VUID-VkDescriptorSetLayoutBinding-descriptorType-00282. The underlying Vulkan driver reads (8 - 1) * 8 = 56 bytes past the allocated bounds on the host heap (GPU-HOST-OOB read) and dereferences the resulting out-of-bounds bytes as non-dispatchable VkSampler handles. In the unsandboxed GPU process environment of Android, this driver-level wild pointer dereference results in memory corruption, enabling a potential sandbox escape.

Note: The exploitation steps described below outline a potential attack path based on static code analysis, as our tooling does not execute dynamic proofs-of-concept.

2. Proof-of-Concept & Detailed Execution Flow

Potential Attacker Steps & Execution Path:

  1. Context & Extension Initialization: The compromised renderer requests a Passthrough GLES2 context. On Android, ANGLE with the Vulkan backend is the default. During initialization, the GL_OES_EGL_image_external_essl3 extension is unconditionally requested and enabled (gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc:252).

  2. Shader Forgery: The attacker submits a fragment shader declaring an array of external samplers:

    GLSL
    #version 300 es
    #extension GL_OES_EGL_image_external_essl3 : require
    precision mediump float;
    uniform sampler2D pad;                 // Assigned bindingIndex = 0
    uniform samplerExternalOES vid[8];     // Assigned bindingIndex = 1, textureUnitsCount = 8
    out vec4 c;
    void main() {
        c = texture(vid[0], vec2(0));
    }
    

    The ANGLE frontend translator accepts arrays of samplerExternalOES. At link time, ProgramExecutable.cpp:1957 processes the uniform and sets samplerBinding.textureUnitsCount to 8.

  3. Texture Instantiation & Binding: The attacker procures a SharedImage mailbox for an AHardwareBuffer containing YCbCr/YUV data and imports it via CreateAndTexStorage2DSharedImageINTERNAL. The resulting Vulkan image has a valid mYcbcrConversionDesc (HardwareBufferImageSiblingVkAndroid.cpp:515-541), causing ImageHelper::hasImmutableSampler() to return true (vk_helpers.h:2960). The texture is bound to texture unit 0.

  4. Triggering Draw Call: The attacker sends gles2::cmds::DrawArrays. ContextVk::updateActiveTextures (ContextVk.cpp:7313) detects the new immutable sampler, setting recreatePipelineLayout = true (ContextVk.cpp:7401-7408).

  5. Bypassing Guard #1: executableVk->createPipelineLayout(...) invokes addTextureDescriptorSetDesc(...) (ProgramExecutableVk.cpp:1388). Here, arraySize is read as 8. The code queries the texture and confirms hasImmutableSampler() is true (ProgramExecutableVk.cpp:1400).

    C++
    ASSERT(samplerBinding.textureUnitsCount == 1); // Guard #1 - Compiles out in release
    // ...
    descOut->addBinding(info.binding, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, arraySize,
                        activeStages, &immutableSampler); // passes arraySize = 8
    
  6. Heap Buffer Allocation & Bypassing Guard #2: Inside vk_cache_utils.cpp:4991 (addBinding), bindingIndex = 1 and count = 8 are processed. The code resizes the vector: mImmutableSamplers.resize(bindingIndex + 1) (i.e., resize(2)). Since mImmutableSamplers is an angle::FastVector<VkSampler, 1>, resizing to 2 spills to a dynamically allocated heap array of 2 * sizeof(VkSampler) = 16 bytes (common/FastVector.h:574-597).

    C++
    ASSERT(count == 1); // Guard #2 - Compiles out in release
    SetBitField(packedBinding.hasImmutableSampler, 1);
    mImmutableSamplers[bindingIndex] = immutableSampler->getHandle(); // stores single handle
    

    The packedBinding.count bitfield is set to 8.

  7. Bypassing Guard #3 & OOB Pointer Setup: getDescriptorSetLayout calls desc.unpackBindings(&bindingVector) (vk_cache_utils.cpp:8487).

    C++
    binding.descriptorCount = packedBinding.count; // descriptorCount = 8
    // ...
    if (packedBinding.hasImmutableSampler) {
        ASSERT(packedBinding.count == 1); // Guard #3 - Compiles out in release
        binding.pImmutableSamplers = &mImmutableSamplers[bindingIndex]; 
    }
    

    pImmutableSamplers points to &mImmutableSamplers[1], the final 8-byte slot of the 16-byte heap allocation.

  8. Driver Sink Execution (OOB Read & Wild Pointer Deref): The binding vector is passed to vkCreateDescriptorSetLayout(device, &createInfo, nullptr, &mHandle) (vk_wrapper.h:2035). Per Vulkan spec, the driver reads descriptorCount (8) elements from pImmutableSamplers. It reads 8 * 8 = 64 bytes starting at &mImmutableSamplers[1], causing a 56-byte host heap OOB read. The driver dereferences these garbage bytes as VkSampler (non-dispatchable) handles, leading to memory corruption.

Suggested Fix

Convert the debug-only ASSERTs to release-build checks. For example, in ProgramExecutableVk::addTextureDescriptorSetDesc and DescriptorSetLayoutDesc::addBinding, if hasImmutableSampler is true and arraySize > 1 (or count > 1), return a validation error (e.g., vk::Result or angle::Result::Stop) and prevent the pipeline layout from being created.

3. Technical Verification Details (Automated Audit Logs)

Verbatim Critic Verdict & Validation Notes:

  • Severity: High (S1)

  • Brief Notes / Reasoning: The vulnerability is a host-heap OOB read leading to a driver-level wild pointer dereference in the GPU process. Root cause: ANGLE's Vulkan backend relies on debug-only ASSERTs to verify that immutable-sampler bindings have a descriptorCount of 1. A compromised renderer can declare a shader with an array of external samplers (e.g., uniform samplerExternalOES vid[8]) and bind a YCbCr AHardwareBuffer texture. This causes vkCreateDescriptorSetLayout to receive a descriptorCount of 8 but a pImmutableSamplers pointer to a FastVector containing only a single VkSampler. The driver reads past the allocation bounds (host-heap OOB read) and dereferences the garbage handles (wild pointer dereference/write).

    Severity Justification (High / S1):

    • Sandbox Escape on Android: Per the severity guidelines and KB, GPU-process memory corruption reachable via forged command-buffer commands from a compromised renderer constitutes a Sandbox Escape on Android (where the GPU process is unsandboxed). This maps to S1.
    • GPU Validating-Layer Gap: The report demonstrates a gap where an attacker-controlled value violates VUID-VkDescriptorSetLayoutBinding-descriptorType-00282 and reaches a driver backend call (vkCreateDescriptorSetLayout) leading to memory corruption (S1).
    • Ceilings & Modifiers: This cannot be Critical (S0) because it is not directly reachable from web content (WebGL does not expose samplerExternalOES), thus it necessitates a compromised renderer. No mitigating factors apply: Vulkan is the default backend on Android, and MiraclePtr does not protect raw heap arrays read by driver code.

Automated Codebase Verification Highlights:

  • ParseContext.cpp verification: EbtSamplerExternalOES is categorized normally in BaseTypes.h:189-191, and ParseContext.cpp:7283-7287 confirms no backend rejections for arrays of external samplers.
  • HardwareBufferImageSiblingVkAndroid.cpp: initImpl (lines 314-572) validates that an external format populates conversionDesc which is assigned to mYcbcrConversionDesc (vk_helpers.cpp:5978), correctly resolving hasImmutableSampler() to true (vk_helpers.h:2960).
  • angle::FastVector: Evaluated third_party/angle/src/common/FastVector.h:183-187 and 570-594. FastVector<T, 1> with N=2 results in dynamic allocation of exactly 2 * 8 = 16 bytes on 64-bit architectures via new value_type[newSize].
  • Layout Sync: Checked vk_wrapper.h:2031-2036 and vk_cache_utils.cpp:5042-5052. Verified that no downstream sanity checks exist between unpackBindings returning descriptorCount = 8 and the raw vkCreateDescriptorSetLayout execution.

Evaluated with Chrome root at commit: b96d2ec58f4f5f92b540a723966b199d6e9951b4


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 code enforced the single-sampler assumption only with debug-only assertions, so release builds passed an array size greater than one alongside a pointer to a buffer holding a single sampler handle.

Impact

On Android, where the GPU process is unsandboxed, the driver-level wild pointer dereference could lead to memory corruption and a potential sandbox escape, though this requires an already compromised renderer and was not demonstrated dynamically.

What the attacker needed

Compromised renderer process; Android device with Vulkan backend; YCbCr hardware buffer texture

The fix

The debug-only assertions should be replaced with release-build checks that reject an immutable sampler binding whose array size is greater than one.

How it was found

  1. Request a Passthrough GLES2 context, which enables the external image extension on Android.
  2. Submit a fragment shader declaring an array of external samplers.
  3. Import a YCbCr hardware buffer texture and bind it to the first texture unit.
  4. Issue a draw call so the pipeline layout is recreated.
  5. The layout description records a descriptor count of eight but stores only one sampler handle.
  6. The driver reads past the heap allocation when creating the descriptor set layout.

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 graphics library called ANGLE translates drawing instructions into calls to the graphics driver. It assumed, but only checked in debug builds, that a certain kind of texture binding always refers to exactly one texture. If an attacker who already controls one part of the browser asks for several, the driver reads past the end of a small memory buffer and treats random bytes as pointers, which can crash or corrupt memory.

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.