Use after free in ANGLE (CVE-2026-10914)
A 32-bit LRU counter in ANGLE's D3D11 buffer cache can wrap around, causing a newly created buffer to be incorrectly evicted and then used, leading to a use-after-free. An attacker could trigger this via a WebGL page to crash the GPU process, resulting in denial of service.
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.
Overview: A 32-bit LRU counter in ANGLE's D3D11 Buffer11 cache can wrap around after 2^32 operations, causing newly created buffer storage objects to be incorrectly identified as the least recently used. This leads to the new buffer being synchronously deleted and immediately accessed, resulting in a Use-After-Free (UAF) and a reliable GPU process crash.
Affected files:
third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cppthird_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
Estimated timestamp from git blame: 2019-12-20
Description
There is a potential Use-After-Free (UAF) vulnerability in the ANGLE D3D11 backend's Buffer11 implementation. The functions getStructuredBufferRangeSRV and getConstantBufferRangeStorage in Buffer11.cpp maintain caches of storage objects using a Least Recently Used (LRU) policy. To track usage, they rely on 32-bit unsigned integer counters (mMaxStructuredBufferLruCount and mMaxConstantBufferLruCount).
When a cache's memory budget is exceeded, an eviction loop uses std::min_element to find and delete the entry with the smallest lruCount.
Because the counter is 32-bit, it can wrap around to 0 after 2^32 operations. When an attacker intentionally wraps this counter and then allocates a new buffer that triggers an eviction, the newly allocated buffer is given a very small lruCount (e.g., 1). The std::min_element logic incorrectly identifies this newly created buffer as the "least recently used" because its wrapped lruCount is smaller than the lruCount of older entries (which might be near 0xFFFFFFFF).
An assertion intended to prevent self-eviction (ASSERT(iter->second.storage != newStorage)) is compiled out in production Release builds. Consequently, SafeDelete is called on the newly created object, freeing it. The code then synchronously continues to use the dangling pointer (e.g., calling resizeStructuredBuffer or updateBufferStorage), resulting in a UAF.
Potential Steps to Trigger
Note: These are suggested steps based on static analysis, as our tooling cannot execute dynamic Proof-of-Concepts.
- Setup: An attacker hosts a malicious WebGL 2 page.
- Counter Wraparound: The JavaScript executes a tight loop of WebGL draw calls that bind structured or constant buffers. This is repeated exactly 2^32 times to silently overflow the 32-bit unsigned
lruCountback to0. - Eviction Trigger: The attacker then binds a new, previously unseen buffer range, requesting a size large enough to exceed the cache's maximum allowed memory budget (
2 * getSize()). - Flawed Eviction:
Buffer11allocates the newStructuredBufferStorageobject and assigns it a wrapped, smalllruCount(e.g.,1). The cache eviction loop triggers andstd::min_elementselects this newly created object for deletion. - Synchronous UAF:
SafeDeletefrees the object. Immediately after, the code callsstructuredBufferStorage->resizeStructuredBuffer(...)on the dangling stack pointer.
Impact
Because the freed memory is accessed synchronously within the exact same C++ function block, an attacker cannot pause execution to interleave JavaScript and spray the GPU process heap. Therefore, this UAF cannot be trivially exploited for Remote Code Execution (RCE).
Instead, accessing the freed memory immediately triggers a crash. If PartitionAlloc's BackupRefPtr (MiraclePtr) or quarantine is enabled, the poisoned memory will safely cause an access violation. Otherwise, it will cause a double-free or null pointer dereference when the inner smart pointers (rx::Resource11) attempt to release their inner COM objects. This results in a reliable Denial of Service (DoS) of the GPU process.
Suggested Fix
- Increase Counter Width: Change the types of
mMaxStructuredBufferLruCountandmMaxConstantBufferLruCountinBuffer11.hfromunsigned inttouint64_t. A 64-bit counter will realistically never overflow during a single browser session. - Robust Eviction Check: Replace the
ASSERTwith a hardifcheck to ensure the newly creatednewStorageis never considered for eviction, or use a proper LRU data structure (likebase::LRUCache) instead of manual counter tracking.
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
Likely a 32-bit unsigned LRU counter can wrap around, and the eviction logic does not exclude the newly created buffer, so it is selected for deletion and then accessed.
Impact
The use-after-free cannot be trivially exploited for remote code execution because the freed memory is accessed synchronously, but it reliably crashes the GPU process, resulting in denial of service; if PartitionAlloc's BackupRefPtr or quarantine is enabled, the crash is a safe access violation.
What the attacker needed
Victim visits a malicious WebGL page; browser uses ANGLE D3D11 backend; 2^32 buffer bind operations
The fix
The counter types should be changed to 64-bit and the assertion replaced with a hard check to prevent self-eviction, or a proper LRU data structure should be used.
How it was found
- Host a malicious WebGL 2 page.
- Execute a tight loop of WebGL draw calls that bind structured or constant buffers exactly 2^32 times to overflow the 32-bit LRU counter.
- Bind a new buffer range large enough to exceed the cache's memory budget.
- The eviction loop selects the newly created buffer for deletion due to its small wrapped LRU count.
- The buffer is freed and then immediately accessed, causing a use-after-free.
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 use-after-free is a bug where a program frees memory but then keeps using it, like deleting a file and then trying to open it. Here, a counter that tracks which buffer was used least recently can overflow and wrap back to zero, so a brand-new buffer looks like the oldest one and gets deleted while still in use. This crashes the graphics process, which an attacker can trigger by visiting a malicious webpage.
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.