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

Heap buffer overflow in ANGLE (CVE-2026-9940)

A heap buffer overflow exists in ANGLE's Vulkan backend when redefining a cubemap face after a staged update for all six faces has been created. An attacker could trigger an out-of-bounds write in the GPU process, potentially leading to remote code execution and sandbox escape on Android.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 43 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 Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.

Overview: A potential heap-buffer-overflow exists in the GPU process when using the ANGLE Vulkan backend due to incorrect pruning of staged updates. Redefining a single cubemap face fails to remove an existing 6-face staged update, which can cause a massive out-of-bounds write when flushed to a smaller destination image.

Affected files:

  • third_party/swiftshader/src/Vulkan/VkImage.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp

Estimated timestamp from git blame: 2025-09-08

Overview

There is a potential heap buffer overflow vulnerability in the GPU process when utilizing ANGLE's Vulkan backend. The issue occurs when redefining the size of a cubemap texture after a staged update has been created for all 6 faces. A flaw in the update pruning logic causes the original, larger staged update to remain active. When flushed, this emits an invalid vkCmdCopyImage command that attempts to copy the large staged extent into a newly allocated, smaller destination image.

Root Cause Analysis

  1. Incorrect Update Pruning: When a cubemap face is redefined via TextureVk::redefineLevel, ANGLE attempts to remove existing staged updates for that face by calling mImage->removeSingleSubresourceStagedUpdates with a layerCount of 1.
  2. Strict Layer Matching: Inside removeSingleSubresourceStagedUpdates, the function matchesLayerRange(layerIndex, layerCount) is used to find matching updates. However, matchesLayerRange strictly requires an exact match on layerCount. If an existing staged update spans all 6 layers (e.g., generated by a state sync from toggling TEXTURE_BASE_LEVEL), it will not match the 1-layer redefinition. Consequently, the 6-layer staged update is not pruned.
  3. Missed Redefinition Masking: If the level being redefined is temporarily considered OutsideAllocatedImage (e.g., because TEXTURE_BASE_LEVEL was increased), TextureRedefineLevel skips updating the mRedefinedLevels bitmask.
  4. Unclamped Copy Extent: When the base level is restored and a draw call forces a flush, flushStagedUpdatesImpl processes the pending updates. Since mRedefinedLevels was not set, the flush is not skipped. The stale, un-pruned 6-layer update is processed, causing ANGLE to emit a vkCmdCopyImage command using the large dimensions of the old staged update against the new, smaller destination image allocation.

Impact

This results in a severe Vulkan Valid Usage violation.

  • On SwiftShader (software Vulkan), the oversized extent passed to Image::copySingleAspectTo results in a linear out-of-bounds memcpy on the CPU heap.
  • On hardware Vulkan drivers (e.g., Android, ChromeOS), this translates to an out-of-bounds DMA write by the GPU.

Because the GPU process is explicitly unsandboxed on Android, successfully exploiting this out-of-bounds write could provide an attacker with a direct path to full device compromise (Remote Code Execution and Sandbox Escape) from a zero-click WebGL2 context.

Suggested Attacker Steps

(Note: These are potential steps as our tooling agent cannot execute code to verify the PoC directly.)

  1. Using WebGL2, initialize a large cubemap (e.g., 2048x2048) on all 6 faces at mip level 0.
  2. Toggle TEXTURE_BASE_LEVEL to 1. This triggers TextureVk::syncState -> respecifyImageStorageIfNecessary, which stages a 6-layer update of the 2048x2048 image to preserve its contents. Level 0 is now considered OutsideAllocatedImage.
  3. Redefine the cubemap faces at mip level 0 to a smaller size (e.g., 600x600) using texImage2D. The 6-layer staged update fails to be pruned due to the layerCount mismatch in matchesLayerRange. mRedefinedLevels is not updated because level 0 is outside the allocated image.
  4. Toggle TEXTURE_BASE_LEVEL back to 0.
  5. Issue a draw call that samples from the cubemap. This forces a flush, causing the Vulkan driver to attempt to copy the 2048x2048 staged image into the new 600x600 destination buffer.

Suggested Fix

The staged update tracking mechanism needs to handle overlapping layer ranges correctly.

  1. Modify matchesLayerRange or the logic inside removeSingleSubresourceStagedUpdates to correctly identify and prune overlapping updates, perhaps by splitting the existing multi-layer update into smaller updates if only a subset of layers is being redefined.
  2. Ensure that mRedefinedLevels is correctly tracked and evaluated even when a level is temporarily outside the allocated image range, preventing stale updates from being flushed inappropriately.

Evaluated with Chrome root at commit: c0eb5541aebfa4ea08806eaf6e94bcc69f87ab2f


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

Impact

On SwiftShader, this causes a linear out-of-bounds memcpy on the CPU heap; on hardware Vulkan drivers, it results in an out-of-bounds DMA write by the GPU, and because the GPU process is unsandboxed on Android, this could lead to full device compromise including remote code execution and sandbox escape.

What the attacker needed

WebGL2 support; ANGLE Vulkan backend; Android or ChromeOS device

The fix

The staged update tracking should be modified to correctly identify and prune overlapping updates, and to ensure the redefinition mask is tracked even when a level is temporarily outside the allocated image range.

How it was found

  1. Initialize a large cubemap on all six faces at mip level 0 using WebGL2.
  2. Toggle TEXTURE_BASE_LEVEL to 1, which stages a six-layer update of the large image.
  3. Redefine the cubemap faces at mip level 0 to a smaller size using texImage2D.
  4. Toggle TEXTURE_BASE_LEVEL back to 0.
  5. Issue a draw call that samples from the cubemap, forcing a flush that attempts to copy the large staged image into the smaller destination buffer.

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 cubemap is a texture made of six square images, like the faces of a cube. When the program changes the size of one face, it should update its internal records, but a mistake leaves an old, larger record in place. Later, when the program tries to copy that old record into the new smaller space, it writes past the end of the memory buffer, which can crash the program or let an attacker run their own code.

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.