Buffer overflow in ANGLE (CVE-2026-79130)
A heap buffer overflow in ANGLE's Vulkan backend occurs when a cubemap's storage is respecified after a face is redefined to a smaller size, because the redefined-levels mask is cleared while stale large staged updates remain pending. An attacker could trigger an out-of-bounds write in the GPU process from a WebGL2 context, potentially leading to remote code execution on platforms where the GPU process is unsandboxed.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
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 heap buffer overflow exists in ANGLE's Vulkan backend due to incorrect handling of redefined cubemap levels. Stale staged updates with large dimensions are applied to a new smaller image because the state tracking mask is cleared prematurely. This allows an attacker to trigger an out-of-bounds memory write in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cppthird_party/angle/src/libANGLE/renderer/renderer_utils.cpp
Estimated timestamp from git blame: Unknown (Google3 checkout)
Summary
A potential heap buffer overflow vulnerability exists in the ANGLE Vulkan backend's texture management. The issue arises when a cubemap texture's storage is respecified after one or more faces have been redefined to a different size. Specifically, the mRedefinedLevels state is cleared in TextureVk::releaseImage while stale staged updates from the previous (larger) image are still pending. When these updates are later flushed to a newly allocated (smaller) image, the absence of the mRedefinedLevels skip-mask causes the updates to be applied with their original large dimensions, leading to an out-of-bounds write.
Potential Attack Sequence
The following steps describe a potential way an attacker could trigger this vulnerability from a WebGL2 context:
- Setup: Create a cubemap texture and bind it to
GL_TEXTURE_CUBE_MAP. SetGL_TEXTURE_MAX_LEVELto 1 andGL_TEXTURE_MIN_FILTERtoGL_NEARESTto control completeness. - Initial Allocation: Initialize all 6 faces at Level 0 to a large dimension (e.g., 512x512) and Level 1 to 256x256 using
texImage2D. Force ANGLE to allocate the underlying 512x512VkImage(e.g., via a dummy draw call). - Redefine Face 0: Use
texImage2Dto redefine only Face 0 at Level 0 to a smaller size (e.g., 64x64). This sets themRedefinedLevelsbitmask for Face 0. The old 512x512VkImageis kept alive, and a 64x64 update is staged for Face 0. - Change Base Level: Set
GL_TEXTURE_BASE_LEVELto 1. This marks the texture state as dirty. - Trigger Respecification: Bind the cubemap and issue a dummy draw call.
ContextVk::syncStatecallsTextureVk::syncState, which detects the base level change and callsTextureVk::respecifyImageStorage. - Stage Stale Updates:
respecifyImageStoragecallsstageSelfAsSubresourceUpdates. This moves the current 512x512 image into aprevImageand stagesUpdateSource::Imageupdates from it. Because Face 0 is inmRedefinedLevels, it is skipped. For Faces 1-5, massive 512x512 updates are appended tomSubresourceUpdates. - Premature Mask Clearing:
respecifyImageStoragethen callsTextureVk::releaseImage. This resets state but crucially leavesmSubresourceUpdatesintact. It then clears the tracking mask:mRedefinedLevels = {}. The 512x512 updates for Faces 1-5 are now orphaned without their skip-mask. - Allocate Level 1: The draw call continues, allocating a new 256x256
VkImage(based onBASE_LEVEL=1).flushImageStagedUpdatesonly flushes Level 1, leaving the 512x512 Level 0 updates safely pending. - Revert Base Level: Set
GL_TEXTURE_BASE_LEVELback to 0. - FBO Attachment: Attach Face 0 (Level 0) to a Framebuffer Object (FBO), leave the texture bound, and trigger
glDrawArrays. - Allocate Small Image:
FramebufferVk::syncStateruns first, detects the base level revert, and reallocates the image. BecauseBASE_LEVELis 0, it uses Face 0's dimensions (64x64) and allocates a tiny 64x64 physicalVkImage. - The Overflow:
TextureVk::syncStatesubsequently callsflushImageStagedUpdatesfor all faces starting at Level 0. BecausemRedefinedLevelswas cleared in step 7, the stale 512x512 updates for Faces 1-5 are NOT skipped.ImageHelper::flushStagedUpdatesImplcallsvkCmdCopyImage, forcing a 512x512 copy into the tiny 64x64VkImage. The Vulkan driver executes this without bounds checking, causing a massive heap buffer overflow.
Impact
This vulnerability allows for an out-of-bounds write in the GPU process. On platforms where the GPU process is unsandboxed (such as Android), this can lead to Remote Code Execution (RCE) and full system compromise from a WebGL context.
Proposed Fix
The core issue is that mRedefinedLevels is cleared while updates that rely on it to be skipped are still staged in mSubresourceUpdates.
In TextureVk::releaseImage (third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp):
onStateChange(angle::SubjectMessage::SubjectChanged);
mRedefinedLevels = {}; // This is premature if updates are still staged
The fix should ensure that either:
mRedefinedLevelsis only cleared ifmImage->hasStagedUpdatesInAllocatedLevels()is false for the relevant levels.- When
mRedefinedLevelsis cleared, any corresponding staged updates that were meant to be skipped are actively removed from theImageHelper'smSubresourceUpdateslist. - As a defense-in-depth measure,
ImageHelper::flushStagedUpdatesImplshould clampvkCmdCopyImageextents to the destination image's actual bounds to prevent driver-level buffer overflows.
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.
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 mRedefinedLevels skip-mask is cleared in TextureVk::releaseImage while stale staged updates that rely on it to be skipped are still pending in mSubresourceUpdates.
Impact
This could allow an out-of-bounds write in the GPU process, leading to remote code execution and full system compromise on platforms where the GPU process is unsandboxed, such as Android.
What the attacker needed
WebGL2 context; GPU process unsandboxed for RCE
The fix
The fix should ensure the redefined-levels mask is only cleared when no relevant staged updates remain, or remove those updates when clearing, and clamp copy extents as defence in depth.
How it was found
- Create a cubemap texture and set its maximum level and filtering to control completeness.
- Allocate all six faces at level 0 to a large size and level 1 to half that size, then force allocation of the underlying image.
- Redefine only face 0 at level 0 to a much smaller size, which sets the redefined-levels mask for that face.
- Change the base level to 1 and issue a draw call to trigger respecification, which stages large updates for the other faces and then clears the mask.
- Revert the base level to 0, attach face 0 to a framebuffer, and trigger a draw call so a small image is allocated and the stale large updates are flushed into it.
- The flush copies large dimensions into the small image, causing an out-of-bounds write.
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. The program keeps a list of pending updates to copy data into the texture's memory. A mistake causes old, large updates to be applied to a new, smaller texture, writing past the end of its memory. This can crash the graphics process or, on some systems, 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.