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.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cppthird_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
- Incorrect Update Pruning: When a cubemap face is redefined via
TextureVk::redefineLevel, ANGLE attempts to remove existing staged updates for that face by callingmImage->removeSingleSubresourceStagedUpdateswith alayerCountof 1. - Strict Layer Matching: Inside
removeSingleSubresourceStagedUpdates, the functionmatchesLayerRange(layerIndex, layerCount)is used to find matching updates. However,matchesLayerRangestrictly requires an exact match onlayerCount. If an existing staged update spans all 6 layers (e.g., generated by a state sync from togglingTEXTURE_BASE_LEVEL), it will not match the 1-layer redefinition. Consequently, the 6-layer staged update is not pruned. - Missed Redefinition Masking: If the level being redefined is temporarily considered
OutsideAllocatedImage(e.g., becauseTEXTURE_BASE_LEVELwas increased),TextureRedefineLevelskips updating themRedefinedLevelsbitmask. - Unclamped Copy Extent: When the base level is restored and a draw call forces a flush,
flushStagedUpdatesImplprocesses the pending updates. SincemRedefinedLevelswas not set, the flush is not skipped. The stale, un-pruned 6-layer update is processed, causing ANGLE to emit avkCmdCopyImagecommand 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::copySingleAspectToresults in a linear out-of-boundsmemcpyon 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.)
- Using WebGL2, initialize a large cubemap (e.g., 2048x2048) on all 6 faces at mip level 0.
- Toggle
TEXTURE_BASE_LEVELto 1. This triggersTextureVk::syncState->respecifyImageStorageIfNecessary, which stages a 6-layer update of the 2048x2048 image to preserve its contents. Level 0 is now consideredOutsideAllocatedImage. - 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 thelayerCountmismatch inmatchesLayerRange.mRedefinedLevelsis not updated because level 0 is outside the allocated image. - Toggle
TEXTURE_BASE_LEVELback to 0. - 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.
- Modify
matchesLayerRangeor the logic insideremoveSingleSubresourceStagedUpdatesto 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. - Ensure that
mRedefinedLevelsis 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.
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
- Initialize a large cubemap on all six faces at mip level 0 using WebGL2.
- Toggle TEXTURE_BASE_LEVEL to 1, which stages a six-layer update of the large image.
- Redefine the cubemap faces at mip level 0 to a smaller size using texImage2D.
- Toggle TEXTURE_BASE_LEVEL back to 0.
- 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.