Use after free in ANGLE (CVE-2026-11065)
A use-after-free flaw in ANGLE's Vulkan backend occurs when a command flush fails under out-of-device-memory conditions, leaving a raw pointer to an ImageHelper in a tracking set. A compromised renderer could exploit this to achieve remote 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. 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 potential Use-After-Free vulnerability exists in ANGLE's Vulkan backend due to incorrect lifecycle management of EGLImages during memory pressure. When a command flush fails under out-of-device-memory conditions, a raw pointer to an ImageHelper is leaked in a tracking set, leading to a UAF when the image is later destroyed. This could allow a compromised renderer to achieve Remote Code Execution in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cppthird_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/android/HardwareBufferImageSiblingVkAndroid.cppthird_party/angle/src/libANGLE/renderer/vulkan/ImageVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.h
Estimated timestamp from git blame: 2025-12-15
Summary
A potential Use-After-Free (UAF) vulnerability in the ANGLE Vulkan backend allows for potential Remote Code Execution (RCE) in the unsandboxed GPU process. The issue stems from a raw pointer being retained in a tracking set within vk::Context when a Vulkan command flush fails due to an out-of-memory error. If the underlying EGLImage is subsequently destroyed, the pointer dangles. A later successful flush during context destruction then accesses this freed memory.
Root Cause Analysis
-
Vulnerable Tracking: In
vk_helpers.h,vk::Context::mForeignImagesInUseis anangle::HashSet<ImageHelper*>. This set uses bare pointers and is not protected byMiraclePtr(as ANGLE does not currently utilizeraw_ptr<T>). -
Swallowed Error in
finalizeImageLayout: When a foreign image is processed,ContextVk::finalizeImageLayout(inContextVk.cpp) attempts to transition the image layout back to the foreign queue by callingflushAndSubmitCommands. However, the result of this call is explicitly cast to(void), discarding any error results:C++ // ContextVk.cpp:7720 (void)flushAndSubmitCommands(nullptr, nullptr, QueueSubmitReason::ForeignImageRelease); -
Incomplete Cleanup on OOM: If the system is under heavy memory pressure,
flushAndSubmitCommandscan fail (e.g.,VK_ERROR_OUT_OF_DEVICE_MEMORY). When it fails early, it skips the call toprepareToSubmitAllCommands(), which is responsible for callingfinalizeAllForeignImages()and removing the image frommForeignImagesInUse. Because the error is swallowed, execution continues, but theImageHelperpointer is left dangling in the tracking set. -
Lifecycle Mismatch: The underlying
EGLImagecan then be destroyed (e.g., viaeglDestroyImage). This eventually reachesHardwareBufferImageSiblingVkAndroid::release, which callsSafeDelete(mImage), freeing theImageHelper. The tracking set in the context now contains a dangling pointer. -
Use-After-Free during Teardown: During context destruction (
eglDestroyContext),gl::Context::onDestroytriggersContextVk::onUnMakeCurrent, which executes a finalflushAndSubmitCommands. If the memory pressure has been relieved, this call succeeds, reachingprepareToSubmitAllCommands->finalizeAllForeignImages. This iterates through the tracking set and callsimage->releaseToForeign(mRenderer)on the freedImageHelperobject, resulting in UAF reads and writes (such as writing a 4-byte zero tomCurrentShaderReadStageMask).
Potential Reproduction Steps
Note: These are suggested/potential steps based on code analysis; our tooling agent does not yet have the ability to run code to provide a working proof-of-concept.
- On Android with the Vulkan backend, an attacker uses WebGL to create an
AHardwareBuffer-backedEGLImageand binds it as a texture. - Trigger a draw call using this texture, which inserts the
ImageHelperpointer into themForeignImagesInUsetracking set. - Induce an Out-Of-Device-Memory (
VK_ERROR_OUT_OF_DEVICE_MEMORY) state by allocating massive textures/buffers. - Delete the original WebGL texture. This orphans the
EGLImageand triggersContextVk::finalizeImageLayout. The flush fails due to the OOM condition, leaving the pointer in the set. - Delete the
EGLImage, which callsSafeDelete(mImage)on theImageHelperwhile its pointer remains in the set. - Relieve the memory pressure by deleting the large allocations from step 3.
- Destroy the WebGL context, triggering teardown. The final successful flush will attempt to finalize the foreign images, dereferencing the freed pointer and triggering the Use-After-Free.
Proposed Fix
Do not silently swallow the error in ContextVk::finalizeImageLayout. If flushAndSubmitCommands fails (or if the context is lost), the image must be explicitly removed from mForeignImagesInUse to prevent it from dangling.
angle::Result result = flushAndSubmitCommands(nullptr, nullptr, QueueSubmitReason::ForeignImageRelease);
if (result != angle::Result::Continue)
{
// Forcefully remove the image from the tracking set to prevent UAF if it is later deleted.
mRenderPassCommands->getCommandState()->removeForeignImage(image);
// Handle error appropriately rather than continuing blindly.
}
Alternatively, consider migrating ANGLE's internal pointer tracking structures to use base::raw_ptr to benefit from MiraclePtr protections.
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 error from flushAndSubmitCommands is ignored, so the image is not removed from the tracking set when the flush fails, leaving a dangling pointer.
Impact
A compromised renderer could achieve remote code execution in the unsandboxed GPU process, though the report notes the reproduction steps are potential and not yet proven.
What the attacker needed
Android device with Vulkan backend; compromised renderer; ability to induce out-of-device-memory
The fix
The error from flushAndSubmitCommands should not be ignored; if it fails, the image must be explicitly removed from the tracking set, or pointer tracking should use MiraclePtr.
How it was found
- On Android with the Vulkan backend, create an AHardwareBuffer-backed EGLImage via WebGL and bind it as a texture.
- Trigger a draw call using this texture, adding the ImageHelper pointer to the tracking set.
- Induce an out-of-device-memory state by allocating large textures or buffers.
- Delete the original WebGL texture, causing finalizeImageLayout to run; the flush fails due to OOM, leaving the pointer in the set.
- Delete the EGLImage, freeing the ImageHelper while its pointer remains in the set.
- Relieve memory pressure by deleting the large allocations, then destroy the WebGL context to trigger teardown and the 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 happens when a program keeps a reference to memory after it has been freed, and later uses that stale reference. Here, a graphics component fails to clean up a pointer when memory runs low, so later it accesses freed memory. An attacker who already controls the renderer could turn this into code execution in a more privileged process.
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.