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

Use after free in ANGLE (CVE-2026-17704)

A use-after-free was reported in ANGLE's Vulkan backend: TextureVk::releaseImage frees the render target vectors before a re-entrant flush, so a cached pointer in the framebuffer's render target cache can be dereferenced after it is freed. An attacker could potentially trigger a stale pointer read during command submission, though the report gives no working proof of concept.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 58 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential Use-After-Free vulnerability exists in ANGLE's Vulkan backend because TextureVk::releaseImage frees RenderTargetVk vector elements before performing a re-entrant flush. Since the front-end framebuffers have not yet been notified of the change, the hasAnyDirtyBit() safety check is bypassed, leading to a dangling pointer dereference during submitCommands.

Affected files:

  • third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ShareGroupVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
  • third_party/angle/src/libANGLE/renderer/RenderTargetCache.h

Estimated timestamp from git blame: 2026-06-01

Description

A potential Use-After-Free (UAF) vulnerability exists in ANGLE's Vulkan backend due to an order-of-operations issue in TextureVk::releaseImage. The function frees vector-backed RenderTargetVk elements before performing a re-entrant flush that triggers submitCommands. This bypasses the !drawFramebuffer->hasAnyDirtyBit() safety check because the front-end framebuffers have not yet been notified of the texture change via observer messages.

Root Cause Analysis

In third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp, the safety check designed to prevent accessing stale/dangling RenderTargetVk cached pointers gates the unsafe getImageWithTileMemory() call on !drawFramebuffer->hasAnyDirtyBit():

C++
// ContextVk.cpp
if (mImageWithTileMemory != nullptr)
{
    ...
    const gl::Framebuffer *drawFramebuffer = mState.getDrawFramebuffer();
    const vk::ImageHelper *drawFBOImageWithTileMemory =
        (drawFramebuffer != nullptr && !drawFramebuffer->hasAnyDirtyBit())
            ? getDrawFramebuffer()->getImageWithTileMemory()   // <-- Potential UAF
            : nullptr;

However, in TextureVk::releaseImage (third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp), the by-value elements of mSingleLayerRenderTargets are cleared (deallocated) before the layout is finalized in shared contexts and before observer notifications are sent:

C++
void TextureVk::releaseImage(ContextVk *contextVk)
{
    ShareGroupVk *shareGroupVk = contextVk->getShareGroup();

    releaseImageViews(contextVk);                                       // (a) FREE RenderTargetVk vectors

    if (mImage)
    {
        shareGroupVk->finalizeImageLayoutInAllSharedContexts(mImage);   // (b) RE-ENTRANT FLUSH → submitCommands
        ...
    }
    ...
    onStateChange(angle::SubjectMessage::SubjectChanged);               // FBO-dirty-bit notification is too late
}

Inside releaseImageViews(contextVk), renderTargetLevels.clear() is called, which frees the std::vector<RenderTargetVk> heap storage. Meanwhile, the active FramebufferVk's mRenderTargetCache.mDepthStencilRenderTarget still holds a bare pointer to one of those elements (&layerRenderTargets[layerIndex]).

When finalizeImageLayoutInAllSharedContexts is called, under specific conditions (e.g., shared contexts with attachment usage or foreign images), it triggers a re-entrant queue submission via flushAndSubmitCommands -> submitCommands. Because onStateChange(SubjectChanged) has not yet run, the front-end gl::Framebuffer dirty bits are empty. Consequently, !drawFramebuffer->hasAnyDirtyBit() evaluates to true, and the code executes getImageWithTileMemory(), causing a UAF read on the freed RenderTargetVk memory.

Potential Trigger Steps

Note: Our tooling does not currently have the capability to run code or execute physical proof-of-concept tests. The following are potential steps that would trigger the path on a target configuration supporting VK_QCOM_tile_memory_heap (e.g., Qualcomm Adreno GPU with driver >= 512.868.1):

  1. Allocate a depth renderbuffer R with tile memory. Render to FBO_A(R), registering ContextVk::mImageWithTileMemory = R.mImage.
  2. Invalidate the depth attachment of FBO_A via glInvalidateFramebuffer(GL_DEPTH_ATTACHMENT), forcing R.mImage->isVkImageContentDefined() = false.
  3. Create a depth texture depthTex that does not use tile memory, and bind it to FBO_B. Issue a draw on FBO_B. This closes the FBO_A render pass. Since the content was undefined, mImageWithTileMemory survives and remains pointing to R.mImage.
  4. During syncState for FBO_B, mRenderTargetCache.mDepthStencilRenderTarget is populated with a bare pointer into depthTex's single-layer render targets vector.
  5. Trigger a level redefinition on depthTex (for example, via glTexImage2D with incompatible dimensions or via foreign EGLImage target bindings). This invokes redefineLevel -> releaseImage.
  6. releaseImage frees the single-layer render targets vector backing the cached pointer, then executes finalizeImageLayoutInAllSharedContexts on depthTex.mImage.
  7. This triggers a layout finalization flush and re-entrant submission before any dirty bit is propagated. The safety guard evaluates to true, resulting in a UAF read in FramebufferVk::getImageWithTileMemory() on the stale cached pointer.

Suggested Fix

To prevent this vulnerability, ensure that the front-end observers/framebuffers are notified of the state changes, or that the render targets are not prematurely freed before the re-entrant shared-context layout finalization occurs.

One potential solution is to re-order the operations in TextureVk::releaseImage so that releaseImageViews(contextVk) (which frees the render target vectors) is called after layout finalization and after observer notifications, or notify the observers of state changes before performing shared context layout finalization:

C++
void TextureVk::releaseImage(ContextVk *contextVk)
{
    ShareGroupVk *shareGroupVk = contextVk->getShareGroup();

    if (mImage)
    {
        shareGroupVk->finalizeImageLayoutInAllSharedContexts(mImage);
        ...
    }

    // Free the image views and render targets after layout finalization has completed
    releaseImageViews(contextVk);
    ...
    onStateChange(angle::SubjectMessage::SubjectChanged);
}

Evaluated with Chrome root at commit: 87214e6721f6c34afd9181b80769a24c0c601c50


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

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 an order-of-operations mistake: render target storage is freed before the re-entrant layout finalisation flush, and the framebuffer dirty-bit notification that would have blocked the stale read is sent afterwards.

Impact

Could cause a use-after-free read in the GPU driver path, potentially leading to a crash or memory corruption, but only on configurations supporting the tile memory heap extension and no exploit was demonstrated.

What the attacker needed

Qualcomm Adreno GPU with recent driver; VK_QCOM_tile_memory_heap support; Shared contexts or foreign images

The fix

The operations in TextureVk::releaseImage should be re-ordered so render targets are freed after layout finalisation and observer notification.

How it was found

  1. Allocate a depth renderbuffer with tile memory and render to a framebuffer using it.
  2. Invalidate the depth attachment so the image content is marked undefined.
  3. Bind a separate depth texture to another framebuffer and draw, closing the earlier render pass.
  4. Trigger a level redefinition on that depth texture so releaseImage runs.
  5. releaseImage frees the render target vector, then finalises the image layout, causing a re-entrant submission.
  6. The safety guard passes and the stale cached pointer is read during getImageWithTileMemory.

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 throws away a piece of memory but keeps a pointer to it and later reads through that pointer. Here the graphics library frees some internal bookkeeping objects, then a later step still looks at one of them because a safety check was not updated in time. The report is theoretical: the authors say they could not run any code to prove it.

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.