Use after free in ANGLE (CVE-2026-9904)
A use-after-free vulnerability in ANGLE's Vulkan backend arises from a 32-bit serial counter wraparound combined with skipped cache invalidation for dynamic uniform buffers. An attacker could force a wraparound to trigger a descriptor set cache collision, causing the Vulkan driver to dereference a destroyed VkBuffer handle, leading to memory corruption in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 56 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 security team.
Overview: A Use-After-Free (UAF) vulnerability exists in ANGLE's Vulkan backend due to a 32-bit serial counter wraparound combined with skipped cache invalidation for dynamic uniform buffers. An attacker can force a 32-bit serial wraparound to trigger a descriptor set cache collision, causing the Vulkan driver to dereference a destroyed VkBuffer handle. This results in memory corruption within the highly privileged GPU process.
Affected files:
src/libANGLE/renderer/vulkan/vk_utils.cppsrc/libANGLE/renderer/vulkan/ProgramExecutableVk.cppsrc/libANGLE/renderer/vulkan/vk_cache_utils.cppsrc/libANGLE/renderer/vulkan/vk_helpers.cppsrc/libANGLE/renderer/vulkan/Suballocation.cpp
Estimated timestamp from git blame: 2026-02-13
Technical Details
A combination of three architectural behaviors in ANGLE's Vulkan backend allows for a potential driver-level Use-After-Free or cross-resource memory corruption triggered from a WebGL context.
1. 32-bit Serial Wraparound (vk_utils.cpp)
ResourceSerialFactory::issueSerial() increments a 32-bit atomic counter (mCurrentUniqueSerial) to generate unique IDs for resources like buffers and images. While it contains an ASSERT(newSerial > 0), this assertion compiles out in release builds. After 2^32 increments, the counter wraps, allowing new resources to be assigned serial numbers previously used by destroyed resources.
2. Intentional Skip of Cache Invalidation (ProgramExecutableVk.cpp)
When using dynamic uniform buffer descriptors (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC), ANGLE deliberately skips registering descriptor set cache entries with the buffer's DescriptorSetCacheManager (lines 2140-2161). The code explicitly notes that maintaining this cache is too expensive, acknowledging that cached descriptor sets will not be immediately destroyed when the underlying BufferBlock is destroyed. Instead, it relies on an LRU cache that evicts entries after 10 frames of inactivity.
3. Cache Key Collision (vk_cache_utils.cpp)
The DescriptorSetDesc used as a cache key identifies buffers by their 32-bit BlockSerial rather than their actual opaque Vulkan VkBuffer handle. Consequently, if a new buffer is assigned a serial number that matches a destroyed buffer, a cache hit will occur even if the underlying Vulkan handles differ.
Potential Exploit Scenario
An attacker can potentially trigger a Use-After-Free via the following steps:
- Prime the Cache: Create a GL buffer (Buffer A) and bind it to a shader program as a uniform buffer. This causes ANGLE to allocate a
VkDescriptorSet(Set D) containing theVkBufferhandle for Buffer A and cache it using Buffer A's serial. - Destroy the Buffer: Delete Buffer A in JavaScript. ANGLE destroys the underlying
VkBuffer. However, due to the intentional invalidation skip (Issue 2), Set D remains in the LRU cache, referencing the destroyed handle. - Defeat LRU Eviction & Wrap Serial: The attacker initiates a tight
while(true)loop across multiple Web Workers, repeatedly callinggl.bufferDatawith empty arrays to trigger new suballocations and serial generation.- By doing this in a tight loop without yielding to the browser event loop, no frame boundaries are triggered (ANGLE's
currentFramecount does not increment). - Because the frame count does not increase, Set D's age never reaches the 10-frame staleness threshold (
kDescriptorSetCacheRetireAge), rendering it immune to eviction. - The loop eventually forces the 32-bit
mCurrentUniqueSerialto wrap around (approximately 4.3 billion calls).
- By doing this in a tight loop without yielding to the browser event loop, no frame boundaries are triggered (ANGLE's
- Trigger Collision: The attacker stops the loop and creates a new buffer (Buffer B). Due to the wraparound, Buffer B is assigned the same serial number previously held by Buffer A.
- Trigger UAF: Use Buffer B with the original shader program. The descriptor set cache returns the stale Set D because the serial-based keys perfectly match. ANGLE skips updating the descriptor set, and the Vulkan driver binds Set D, which still contains the destroyed handle for Buffer A.
- Result: The driver dereferences the destroyed handle during rendering. Because the handle is an opaque Vulkan type and the dereference happens at the driver level, MiraclePtr provides no protection, leading to memory corruption in the GPU process.
Note: Our tooling agent cannot run code, so these steps are suggested based on static code analysis.
Suggested Fix
Upgrade the mCurrentUniqueSerial counter in ResourceSerialFactory to a 64-bit atomic counter (std::atomic<uint64_t>). This guarantees the serial space will never wrap around during the lifetime of a renderer process, permanently preventing the cache collision.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
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
Root cause
Likely the root cause is the use of a 32-bit serial counter that can wrap around, combined with the intentional skipping of cache invalidation for dynamic uniform buffer descriptors, leading to cache key collisions when serials are reused.
Impact
The vulnerability could lead to memory corruption within the highly privileged GPU process, potentially allowing an attacker to execute arbitrary code or cause a denial of service.
What the attacker needed
WebGL support in browser; Ability to run JavaScript; Multiple Web Workers
The fix
The fix is to upgrade the serial counter to a 64-bit atomic counter to prevent wraparound and cache collisions.
How it was found
- Create a GL buffer (Buffer A) and bind it as a uniform buffer to a shader program, causing ANGLE to allocate and cache a descriptor set.
- Delete Buffer A, which destroys the underlying VkBuffer but leaves the cached descriptor set in the LRU cache due to skipped invalidation.
- In a tight loop across multiple Web Workers, repeatedly call gl.bufferData with empty arrays to generate new suballocations and serials, preventing frame increments and forcing the 32-bit serial counter to wrap around.
- Stop the loop and create a new buffer (Buffer B) that receives the same serial number as the destroyed Buffer A.
- Use Buffer B with the original shader program, causing the cache to return the stale descriptor set that references the destroyed VkBuffer handle.
- The Vulkan driver dereferences the destroyed handle during rendering, resulting in memory corruption in the GPU process.
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.
This report describes a memory safety bug in a graphics component called ANGLE, which translates WebGL commands to Vulkan. A counter that gives each resource a unique number can wrap around after about 4.3 billion uses, so a new resource can get the same number as an old, deleted one. Because a cache is not properly cleared, the system may reuse an old entry that points to a deleted resource, causing the program to access memory that is no longer valid.
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.