Use after free in ANGLE (CVE-2026-10913)
A use-after-free flaw in ANGLE's D3D11 backend occurs when an allocation error during texture storage release skips disassociating an image, leaving a dangling pointer. An attacker who can exhaust GPU memory could later trigger a virtual call on freed memory, potentially achieving arbitrary code execution in the GPU process.
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 potential Use-After-Free (UAF) vulnerability exists in ANGLE's D3D11 backend due to improper error handling during texture storage release. If an allocation error occurs while recovering image data, an early return skips disassociating the image before the storage is unconditionally deleted. When the image is later destroyed, it makes a virtual function call using the dangling pointer, which can lead to arbitrary code execution in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cppthird_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cppthird_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cppthird_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.hthird_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h
Estimated timestamp from git blame: 2018-07-25
Vulnerability Details
A potential Use-After-Free vulnerability has been identified in the ANGLE D3D11 renderer involving the bidirectional association between Image11 and TextureStorage11.
When a texture is redefined, TextureD3D::releaseTexStorage is called. This function first gives the storage a chance to gracefully recover data into local images by calling mTexStorage->onDestroy(context), and then unconditionally frees the storage using SafeDelete(mTexStorage) (TextureD3D.cpp:862).
Inside TextureStorage11_2D::onDestroy, it iterates through its associated Image11 objects and calls ANGLE_TRY(mAssociatedImages[i]->recoverFromAssociatedStorage(context)) (TextureStorage11.cpp:1102).
The flaw occurs in Image11::recoverFromAssociatedStorage (Image11.cpp:192). If this function encounters an error (for example, E_OUTOFMEMORY when attempting to allocate a staging texture via createStagingTexture), the ANGLE_TRY macro causes an immediate early return.
Crucially, this early return skips the disassociateStorage() call on line 207. The Image11 object is left in a corrupted state: its mRecoverFromStorage flag remains true, and its mAssociatedStorage member holds a raw, dangling pointer to the TextureStorage11 object. Because TextureD3D::releaseTexStorage unconditionally calls SafeDelete, the storage object is freed.
Later, when the Image11 object is destroyed (e.g., during context teardown), its destructor calls disassociateStorage(). Because mRecoverFromStorage is still true, it attempts to execute mAssociatedStorage->disassociateImage(...) (Image11.cpp:220). Since disassociateImage is a pure virtual function, this results in a virtual method call on freed memory.
Exploitability:
ANGLE uses native C++ raw pointers (T*), meaning these objects are not protected by Chromium's MiraclePtr (BackupRefPtr) mitigation. An attacker who can exhaust GPU memory to trigger the early return can subsequently use a secondary WebGL context to spray the heap, reclaim the freed TextureStorage11 memory, and control the vtable pointer to achieve arbitrary Remote Code Execution (RCE) in the sandboxed GPU process.
Potential Attacker Steps
Note: These are suggested steps based on source code analysis; our tooling has not yet run a live proof-of-concept.
- Initialize: Create two WebGL contexts: Context A (victim) and Context B (spray/memory pressure).
- Prime State: In Context A, create a texture and draw with it to allocate a
TextureStorage11_2Dand link it to anImage11(settingmRecoverFromStorage = true). - Induce Failure: Use Context B to allocate massive amounts of memory, pushing the GPU into an Out-Of-Memory state.
- Trigger UAF: In Context A, redefine the texture dimensions via
gl.texImage2D. This callsreleaseTexStorage. The OOM condition causesrecoverFromAssociatedStorageto abort early viaANGLE_TRY. TheTextureStorage11_2Dis freed, leaving a dangling pointer inImage11. - Reclaim Memory: Use Context B to spray the heap with objects matching the size of
TextureStorage11_2D, writing a controlled fake vtable pointer at the beginning of the reclaimed memory block. - Execute: Delete the texture or destroy Context A. The
Image11destructor invokesdisassociateStorage(), which makes a virtual call via the attacker-controlled vtable, hijacking control flow.
Suggested Fix
Ensure that the association between Image11 and TextureStorage11 is reliably broken even if data recovery fails.
One approach is to modify Image11::recoverFromAssociatedStorage to use an RAII scope guard (or a try/catch-like pattern using standard boolean checks instead of ANGLE_TRY for the allocations) so that disassociateStorage() is guaranteed to execute regardless of whether the staging texture allocation succeeds or fails.
Alternatively, TextureStorage11::onDestroy or the TextureStorage11 destructor could explicitly iterate through mAssociatedImages and manually clear their mAssociatedStorage pointers before the object is deleted.
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, the early return from an error path in Image11::recoverFromAssociatedStorage skips the disassociateStorage call, leaving a dangling pointer that is later used in the destructor.
Impact
An attacker who can exhaust GPU memory could potentially achieve arbitrary code execution in the sandboxed GPU process, though the report notes this is based on source code analysis without a live proof-of-concept.
What the attacker needed
Ability to run WebGL; ability to exhaust GPU memory; no user interaction required
The fix
The association between Image11 and TextureStorage11 should be reliably broken even if data recovery fails, for example by using an RAII scope guard or by explicitly clearing pointers in onDestroy.
How it was found
- Create two WebGL contexts: one victim and one for memory pressure.
- In the victim context, create a texture and draw with it to allocate storage and link an image.
- Use the second context to allocate massive amounts of memory, causing an out-of-memory condition.
- In the victim context, redefine the texture dimensions to trigger releaseTexStorage, which aborts early due to OOM and frees the storage while leaving a dangling pointer.
- Use the second context to spray the heap with objects matching the freed storage size and a controlled fake vtable pointer.
- Delete the texture or destroy the victim context to trigger a virtual call via the attacker-controlled vtable.
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 is a memory safety bug where a program frees an object but keeps a pointer to it, then later uses that pointer. An attacker who can force a memory allocation to fail might be able to reuse that freed memory for their own data and hijack the program's control flow. The report is based on code analysis, not a live proof-of-concept.
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.