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

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

ANGLE's Vulkan backend built an invalid Vulkan copy structure when copying into a 3D texture with a non-zero z offset, setting a non-zero base array layer that the specification forbids for 3D images. This could make the GPU driver compute an out-of-bounds destination address and write attacker-controlled pixel data beyond the texture's GPU memory.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 47 days

Flapjack, 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: When using copyTexSubImage3D with a non-zero zoffset, ANGLE's Vulkan backend creates an invalid VkBufferImageCopy structure with a non-zero baseArrayLayer for 3D textures. This violates Vulkan specifications and causes the GPU driver to calculate an out-of-bounds destination address, allowing arbitrary writes to GPU memory.

Affected files:

  • third_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cpp
  • third_party/angle/src/libANGLE/Context.cpp

Estimated timestamp from git blame: Unknown (Google3 checkout)

Description

A potential Out-Of-Bounds (OOB) Write vulnerability exists in the ANGLE Vulkan backend when processing updates for 3D textures via the copyTexSubImage3D WebGL 2.0 API. By providing a non-zero zoffset, an attacker can trick ANGLE into constructing a malformed VkBufferImageCopy command. This command violates the Vulkan specification, causing the underlying graphics driver to perform memory copy operations out-of-bounds in GPU memory.

Root Cause Analysis

The vulnerability stems from how ANGLE tracks the Z-slice offset (depth) when staging updates for 3D textures from a framebuffer.

  1. In third_party/angle/src/libANGLE/Context.cpp, Context::copyTexSubImage3D creates an ImageIndex representing the subresource destination: ImageIndex index = ImageIndex::MakeFromType(TextureTargetToType(target), level, zoffset); For a 3D texture, this explicitly sets the internal mLayerIndex to the value of zoffset.

  2. The offset is also separately tracked in a gl::Offset destOffset(xoffset, yoffset, zoffset);.

  3. If the copy falls back to a CPU readback path (e.g., due to incompatible format combinations between the framebuffer and the 3D texture), execution reaches ImageHelper::stageSubresourceUpdateFromFramebuffer in third_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cpp.

  4. Here, ANGLE populates a VkBufferImageCopy structure (copyToImage) to instruct the Vulkan driver to copy the readback data. It incorrectly uses the ImageIndex to set the baseArrayLayer: copyToImage.imageSubresource.baseArrayLayer = index.hasLayer() ? index.getLayerIndex() : 0; Because mLayerIndex was set to zoffset, index.hasLayer() evaluates to true, and baseArrayLayer becomes zoffset.

  5. Concurrently, it sets the Z image offset: gl_vk::GetOffset(dstOffset, &copyToImage.imageOffset); This sets copyToImage.imageOffset.z to zoffset.

  6. According to the Vulkan API Specification (VUID-VkBufferImageCopy-imageSubresource-07971), for any image of type VK_IMAGE_TYPE_3D, the baseArrayLayer member must be exactly 0.

By passing a non-zero baseArrayLayer alongside a non-zero imageOffset.z, the Vulkan driver's destination address calculation processes a massive "double-offset". It shifts the address by zoffset * VolumeSize (interpreting the layer as a full 3D volume) plus zoffset * SliceSize. Because 3D textures allocate only a single volume layer, this calculation results in an address far outside the bounds of the VkDeviceMemory allocated for the texture.

Potential Attacker Steps

(Note: These are suggested steps based on source code analysis; a full working proof of concept has not been executed yet.)

  1. The attacker creates a WebGL 2.0 context.
  2. Using JavaScript, the attacker creates a 3D texture (gl.texImage3D).
  3. The attacker creates a framebuffer and attaches a 2D texture or renderbuffer to it, filling it with attacker-controlled pixel data.
  4. The attacker carefully selects a format combination for the framebuffer and 3D texture that cannot be copied using fast GPU transfer paths, forcing ANGLE into the CPU readback fallback (stageSubresourceUpdateFromFramebuffer).
  5. The attacker calls gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, N, 0, 0, W, H) with a large, non-zero zoffset (N).
  6. The Vulkan driver executes the out-of-bounds DMA copy, writing the attacker's framebuffer data over adjacent GPU memory allocations (e.g., command buffers, shader binaries).
  7. The attacker leverages this to hijack GPU execution, achieving Remote Code Execution in the GPU process. On platforms where the GPU process is unsandboxed (like Android), this leads to a full sandbox escape.

Suggested Fix

In ImageHelper::stageSubresourceUpdateFromFramebuffer (and similarly in ImageHelper::stageSubresourceUpdate at line 8654), explicitly verify whether the target is an array texture before utilizing index.getLayerIndex(). If the texture is a 3D texture (i.e., gl::IsArrayTextureType(index.getType()) is false or the image type is VK_IMAGE_TYPE_3D), baseArrayLayer must be strictly set to 0.

For example:

C++
if (gl::IsArrayTextureType(index.getType()))
{
    copyToImage.imageSubresource.baseArrayLayer = index.hasLayer() ? index.getLayerIndex() : 0;
    copyToImage.imageSubresource.layerCount     = index.getLayerCount();
}
else
{
    copyToImage.imageSubresource.baseArrayLayer = 0;
    copyToImage.imageSubresource.layerCount     = 1;
    // Ensure dstOffset handles the Z-slice offset appropriately.
}

This mirrors the correct handling already present in ImageHelper::stageSubresourceUpdateFromImage.

Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb


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 reused the z offset as the array layer index for a 3D texture, so the generated Vulkan copy command had a non-zero baseArrayLayer, which the specification requires to be zero for 3D images.

Impact

The report claims this could corrupt adjacent GPU memory and potentially lead to code execution in the GPU process, and on platforms where that process is unsandboxed, a sandbox escape; these steps were not demonstrated.

What the attacker needed

Victim loads a malicious web page; WebGL 2.0 support; format combo forcing CPU readback

The fix

The code should check whether the target is an array texture and force baseArrayLayer to zero with a layer count of one for 3D textures, mirroring the handling already used elsewhere.

How it was found

  1. Create a WebGL 2.0 context.
  2. Create a 3D texture.
  3. Create a framebuffer with a 2D texture or renderbuffer attached and fill it with chosen pixel data.
  4. Pick a format combination that forces the CPU readback fallback path.
  5. Call copyTexSubImage3D with a large non-zero z offset.
  6. The driver performs the out-of-bounds copy into adjacent GPU memory.

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.

Web pages can draw with WebGL, and ANGLE is the layer in Chrome that translates those drawing commands into Vulkan, the graphics API used by the GPU driver. When copying a small image into a slice of a 3D texture, ANGLE filled in one field of the driver instruction wrongly, so the driver could write past the end of the texture's memory. The report is based on reading the source code; no working exploit was run.

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.