Skip to content
Memory corruption Advisory Advanced CVE-2026-11065

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.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/android/HardwareBufferImageSiblingVkAndroid.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ImageVk.cpp
  • third_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

  1. Vulnerable Tracking: In vk_helpers.h, vk::Context::mForeignImagesInUse is an angle::HashSet<ImageHelper*>. This set uses bare pointers and is not protected by MiraclePtr (as ANGLE does not currently utilize raw_ptr<T>).

  2. Swallowed Error in finalizeImageLayout: When a foreign image is processed, ContextVk::finalizeImageLayout (in ContextVk.cpp) attempts to transition the image layout back to the foreign queue by calling flushAndSubmitCommands. 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);
    
  3. Incomplete Cleanup on OOM: If the system is under heavy memory pressure, flushAndSubmitCommands can fail (e.g., VK_ERROR_OUT_OF_DEVICE_MEMORY). When it fails early, it skips the call to prepareToSubmitAllCommands(), which is responsible for calling finalizeAllForeignImages() and removing the image from mForeignImagesInUse. Because the error is swallowed, execution continues, but the ImageHelper pointer is left dangling in the tracking set.

  4. Lifecycle Mismatch: The underlying EGLImage can then be destroyed (e.g., via eglDestroyImage). This eventually reaches HardwareBufferImageSiblingVkAndroid::release, which calls SafeDelete(mImage), freeing the ImageHelper. The tracking set in the context now contains a dangling pointer.

  5. Use-After-Free during Teardown: During context destruction (eglDestroyContext), gl::Context::onDestroy triggers ContextVk::onUnMakeCurrent, which executes a final flushAndSubmitCommands. If the memory pressure has been relieved, this call succeeds, reaching prepareToSubmitAllCommands -> finalizeAllForeignImages. This iterates through the tracking set and calls image->releaseToForeign(mRenderer) on the freed ImageHelper object, resulting in UAF reads and writes (such as writing a 4-byte zero to mCurrentShaderReadStageMask).

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.

  1. On Android with the Vulkan backend, an attacker uses WebGL to create an AHardwareBuffer-backed EGLImage and binds it as a texture.
  2. Trigger a draw call using this texture, which inserts the ImageHelper pointer into the mForeignImagesInUse tracking set.
  3. Induce an Out-Of-Device-Memory (VK_ERROR_OUT_OF_DEVICE_MEMORY) state by allocating massive textures/buffers.
  4. Delete the original WebGL texture. This orphans the EGLImage and triggers ContextVk::finalizeImageLayout. The flush fails due to the OOM condition, leaving the pointer in the set.
  5. Delete the EGLImage, which calls SafeDelete(mImage) on the ImageHelper while its pointer remains in the set.
  6. Relieve the memory pressure by deleting the large allocations from step 3.
  7. 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.

C++
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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

  1. On Android with the Vulkan backend, create an AHardwareBuffer-backed EGLImage via WebGL and bind it as a texture.
  2. Trigger a draw call using this texture, adding the ImageHelper pointer to the tracking set.
  3. Induce an out-of-device-memory state by allocating large textures or buffers.
  4. Delete the original WebGL texture, causing finalizeImageLayout to run; the flush fails due to OOM, leaving the pointer in the set.
  5. Delete the EGLImage, freeing the ImageHelper while its pointer remains in the set.
  6. 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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.