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

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

A use-after-free exists in ANGLE's EGLImage handling on Windows when a source texture is destroyed during memory pressure. If orphaning fails, a dangling pointer to the freed texture remains and can be dereferenced during rendering or image destruction, potentially leading to control-flow hijacking or heap corruption.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 4 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 Chrome Security team. 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 (UAF) vulnerability exists in ANGLE's EGLImage implementation on Windows when a source texture is destroyed during Out-Of-Memory (OOM) conditions. If the backend fails to orphan the source sibling due to an allocation failure, a raw pointer to the freed object is retained in the image state. This dangling pointer can subsequently be dereferenced during rendering or upon the image's own destruction.

Affected files:

  • third_party/angle/src/libANGLE/Image.cpp
  • third_party/angle/src/libANGLE/renderer/d3d/EGLImageD3D.cpp
  • third_party/angle/src/libANGLE/Texture.cpp
  • third_party/angle/src/libANGLE/Renderbuffer.cpp

Estimated timestamp from git blame: 2018-07-27

The vulnerability is located in ANGLE's EGLImage management logic, primarily affecting the D3D11 backend on Windows. When an ImageSibling (such as a gl::Texture or gl::Renderbuffer) that serves as the source for an egl::Image is destroyed, ANGLE attempts to "orphan" the sibling. Orphaning is intended to detach the image from its source while preserving its content for other objects that may still be using the image.

In third_party/angle/src/libANGLE/Image.cpp, the function Image::orphanSibling calls the backend's implementation of orphan:

C++
angle::Result Image::orphanSibling(const gl::Context *context, ImageSibling *sibling) {
    ANGLE_TRY(mImplementation->orphan(context, sibling)); // [1] Returns early on error
    if (mState.source == sibling) {
        ...
        mState.source = nullptr; // [2] Never reached if ANGLE_TRY fails
    }
}

In the D3D11 backend (third_party/angle/src/libANGLE/renderer/d3d/EGLImageD3D.cpp), orphan calls copyToLocalRendertarget, which attempts to create a copy of the texture's render target. If this allocation fails (e.g., due to VRAM exhaustion), it returns an error. Because of the ANGLE_TRY macro at [1], the error causes the function to return immediately, skipping the crucial line at [2] that nulls the mState.source pointer.

When the source object is a gl::Texture or gl::Renderbuffer, its destruction proceeds even if orphaning fails because the error is explicitly ignored in the onDestroy method (e.g., in third_party/angle/src/libANGLE/Texture.cpp):

C++
void Texture::onDestroy(const Context *context) {
    ...
    egl::RefCountObjectReleaser<egl::Image> releaseImage;
    (void)orphanImages(context, &releaseImage); // [3] Error is swallowed
    ...
}

As a result, the egl::Image maintains a dangling raw pointer to the now-freed gl::Texture object.

Potential Sinks and Impact

The dangling pointer can be dereferenced in several ways:

  1. Virtual Function Calls: Rendering using a target texture that refers to the orphaned egl::Image will eventually call EGLImageD3D::getRenderTarget. This method performs a virtual call (getAttachmentRenderTarget) on the dangling mState.source pointer, potentially allowing for control flow hijacking.
  2. Heap Corruption: When the egl::Image itself is destroyed, Image::onDestroy calls mState.source->removeImageSource(this). This leads to a memory write to the freed memory at the offset of the mSourcesOf member, which can be leveraged for memory corruption exploits.

Suggested Potential Steps to Reproduce

An attacker operating from a compromised renderer could potentially follow these steps:

  1. Induce heavy VRAM pressure in the GPU process by allocating many large textures.
  2. Create a SharedImage with initial pixel data. On Windows, this frequently triggers the EGLImageBacking path, which creates an egl::Image from a source GL texture and then attempts to release the source texture immediately if no workarounds are active.
  3. Trigger the destruction of the source texture. If orphaning fails due to the VRAM pressure, the egl::Image retains a dangling pointer to the texture.
  4. Attempt to use or destroy the SharedImage to trigger a dereference of the dangling pointer.

Recommended Fix

The Image::orphanSibling logic should be modified to ensure that mState.source is nulled out even if the backend orphaning call returns an error. While the backend might fail to preserve the data under OOM conditions, the reference to the dying sibling must be cleared to maintain memory safety.

Note: These findings are based on manual code review; a working proof-of-concept has not yet been produced.

Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e


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 the error from the backend orphaning call is not handled, so the source pointer is not cleared when orphaning fails.

Impact

An attacker operating from a compromised renderer could potentially achieve control flow hijacking or heap corruption, though no working proof-of-concept has been produced.

What the attacker needed

Compromised renderer; Windows with D3D11 backend; ability to induce VRAM pressure

The fix

The Image::orphanSibling logic should be modified to ensure that mState.source is nulled out even if the backend orphaning call returns an error.

How it was found

  1. Induce heavy VRAM pressure in the GPU process by allocating many large textures.
  2. Create a SharedImage with initial pixel data, triggering the EGLImageBacking path that creates an egl::Image from a source GL texture.
  3. Trigger destruction of the source texture; if orphaning fails due to VRAM pressure, the egl::Image retains a dangling pointer.
  4. Attempt to use or destroy the SharedImage to trigger a dereference of the dangling pointer.

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 pointer to memory it has already freed and later uses it again. Here, ANGLE (the graphics layer Chrome uses) fails to clear a reference to a texture that has been destroyed, so later drawing or cleanup can touch freed memory. An attacker who can already run code in the renderer might exploit this to corrupt memory or hijack control flow.

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.