Use after free in ANGLE (CVE-2026-9901)
A use-after-free exists in ANGLE's Vulkan backend when a texture bound to multiple framebuffer colour attachments is respecified, leaving dangling render target pointers that are later dereferenced. An attacker able to manipulate GPU process heap allocations could potentially reclaim the freed memory and hijack virtual calls, leading to remote code execution in the sandboxed GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 59 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A potential use-after-free exists in ANGLE's Vulkan backend during framebuffer state synchronization. When a texture attached to multiple color slots undergoes storage respecification, it destroys all associated RenderTargetVk objects, but re-entrant dirty bit notifications are ignored by the active sync loop. This leaves dangling raw pointers in the framebuffer's render target cache that are subsequently dereferenced, potentially allowing RCE in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cppthird_party/angle/src/libANGLE/Framebuffer.cppthird_party/angle/src/libANGLE/Texture.cppthird_party/angle/src/libANGLE/renderer/RenderTargetCache.h
Estimated timestamp from git blame: 2026-01-30
Description
A potential Use-After-Free (UAF) vulnerability exists in ANGLE's Vulkan backend related to how gl::Framebuffer synchronizes state with FramebufferVk. The issue occurs when a single texture is bound to multiple framebuffer color attachments, and a state change triggers an image storage respecification.
When gl::Framebuffer::syncState is called, it takes a snapshot of the current dirty bits (mDirtyBitsGuard = mDirtyBits;) and passes this to the Vulkan backend. FramebufferVk::syncState iterates over this snapshot using a BitSetIterator.
If processing a dirty attachment (e.g., GL_COLOR_ATTACHMENT0) requires the underlying texture to respecify its image storage (e.g., via TextureVk::respecifyImageStorageIfNecessary), the texture destroys its existing Vulkan image and clears all cached RenderTargetVk objects by calling releaseImageViews. This frees the memory for all render targets associated with this texture, including those bound to other attachments (e.g., GL_COLOR_ATTACHMENT1).
The texture broadcasts a SubjectChanged notification regarding this recreation. gl::Framebuffer receives this and re-entrantly sets the dirty bit for the other affected attachments (DIRTY_BIT_COLOR_BUFFER_CONTENTS_1). However, because FramebufferVk::syncState is iterating over a by-value snapshot of the dirty bits, it ignores this newly set bit and fails to update the render target cache for attachment 1.
After the sync loop completes, FramebufferVk::syncState calls updateColorAttachmentColorspace and later startNewRenderPass. Both of these methods iterate over all active color attachments and dereference the raw RenderTargetVk* pointers stored in mRenderTargetCache. For attachment 1, this pointer is now dangling, resulting in a use-after-free.
Finally, when mImpl->syncState returns, gl::Framebuffer::syncState unconditionally executes mDirtyBits.reset(), permanently discarding the re-entrant notification and cementing the stale cache.
Potential Trigger Steps
Note: These are suggested steps based on static code analysis; our tooling agent does not currently have the capability to execute a working proof-of-concept.
- Create a 2D Array Texture or 3D Texture with multiple layers.
- Create a Framebuffer and attach layer 0 to
GL_COLOR_ATTACHMENT0and layer 1 toGL_COLOR_ATTACHMENT1. - Issue a draw call to populate the backend
RenderTargetCachewith validRenderTargetVkpointers. - Bind the texture to an image unit (e.g.,
glBindImageTexture(0, texture, ...)). This flags the texture to requireVK_IMAGE_USAGE_STORAGE_BITbut does not trigger a state notification. - Re-bind layer 0 to
GL_COLOR_ATTACHMENT0to dirty only the first attachment in the framebuffer'smDirtyBits. - Issue a second draw call.
FramebufferVk::syncStatewill process attachment 0, trigger the storage respecification (freeing attachment 1'sRenderTargetVk), ignore the re-entrant dirty bit for attachment 1, and subsequently dereference the freed pointer for attachment 1.
Exploitability
The RenderTargetVk objects are stored as raw pointers within RenderTargetCache and are not protected by MiraclePtr (BRP) within the ANGLE component. An attacker with the ability to manipulate heap allocations in the GPU process could reclaim the freed RenderTargetVk memory. By forging internal pointers (such as vk::ImageHelper*), the attacker can hijack virtual method calls (e.g., image->hasSubresourceDefinedContent()) triggered during startNewRenderPass, potentially achieving Remote Code Execution (RCE) in the sandboxed GPU process.
Proposed Fix
- Do not unconditionally discard re-entrant dirty bits: In
gl::Framebuffer::syncState, instead of unconditionally callingmDirtyBits.reset(), the code should clear only the bits that were actually processed (e.g.,mDirtyBits &= ~mDirtyBitsGuard;), or loop untilmDirtyBits.none()is true to ensure re-entrant updates are handled before drawing. - Safe Caching:
RenderTargetCacheshould ideally not rely on raw pointers. Using weak pointers or an observer pattern to explicitly nullify cached render targets when their underlying storage is destroyed would prevent the dangling pointer dereference entirely.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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
Root cause
The sync loop iterates over a by-value snapshot of dirty bits, so a re-entrant dirty bit set during texture respecification is ignored and the stale render target cache entry is not refreshed before being dereferenced.
Impact
An attacker with the ability to manipulate heap allocations in the GPU process could reclaim the freed memory and hijack virtual method calls, potentially achieving remote code execution in the sandboxed GPU process.
What the attacker needed
Ability to manipulate GPU process heap; texture bound to multiple colour attachments; storage respecification triggered
The fix
The code should clear only the dirty bits that were actually processed or loop until no dirty bits remain, and the render target cache should use weak pointers or an observer pattern to nullify entries when storage is destroyed.
How it was found
- Create a 2D array or 3D texture with multiple layers.
- Create a framebuffer and attach layer 0 to colour attachment 0 and layer 1 to colour attachment 1.
- Issue a draw call to populate the render target cache with valid pointers.
- Bind the texture to an image unit so it requires storage usage without triggering a state notification.
- Re-bind layer 0 to colour attachment 0 to dirty only the first attachment.
- Issue a second draw call, which processes attachment 0, frees attachment 1's render target, ignores the re-entrant dirty bit, and dereferences the freed pointer.
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 texture can be attached to more than one colour output of a framebuffer. When the program changes the texture's storage, the engine frees the internal objects for all attachments but only marks one attachment as needing an update, so another attachment keeps a pointer to freed memory. Later code follows that stale pointer, which can crash or, if an attacker controls the freed memory, 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.