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

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

A use-after-free in ANGLE's D3D11 backend occurs when a mapped buffer's staging storage is garbage-collected because the buffer is bound to multiple uniform blocks and drawn. An attacker with a compromised renderer could potentially execute arbitrary code in the GPU process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 47 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 without the Chrome Security team.

Overview: A Use-After-Free vulnerability exists in ANGLE's D3D11 backend when a mapped buffer's staging storage is prematurely garbage-collected. This occurs if a read-only mapped buffer is bound to multiple uniform blocks and drawn, causing its idleness counter to exceed the deallocation threshold. An attacker could potentially exploit this from a compromised renderer to execute arbitrary code in the GPU process.

Affected files:

  • third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
  • third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
  • third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp

Estimated timestamp from git blame: 2025-05-14

Vulnerability Details

In ANGLE's D3D11 backend, Buffer11 manages multiple storage representations for a single GL buffer (e.g., SYSTEM_MEMORY, STAGING, UNIFORM). To optimize memory, Buffer11::garbageCollection periodically deallocates unused storages.

A Use-After-Free (UAF) condition can occur because the raw pointer Buffer11::mMappedStorage can be left dangling if its underlying storage object is reclaimed by garbage collection while the buffer is mapped. This relies on two distinct logic flaws:

  1. Priority Inversion in Mapping: When a buffer is mapped with GL_MAP_READ_BIT and its mLatestBufferStorage is SYSTEM_MEMORY, Buffer11::mapRange creates a STAGING storage to provide CPU access. However, because BUFFER_USAGE_STAGING (index 1) does not have a strictly lower priority index than BUFFER_USAGE_SYSTEM_MEMORY (index 0), mLatestBufferStorage remains pointing to SYSTEM_MEMORY. mMappedStorage is set to the new STAGING storage.
  2. Lack of UBO Mapping Validation: ANGLE's draw-time validation (ValidateDrawStates) correctly prevents drawing if vertex or index buffers are mapped, but fails to validate the mapped state of Uniform Buffers (UBOs).

If a draw call is issued while the buffer is mapped and bound to multiple uniform blocks, StateManager11::syncUniformBuffersForShader iterates through the uniform bindings. For each binding, it calls Buffer11::getConstantBufferRange, which ultimately triggers garbageCollection and checkForDeallocation(BUFFER_USAGE_STAGING).

Each iteration increments mIdleness[BUFFER_USAGE_STAGING]. If the shader uses more than 8 uniform block bindings (the default deallocation threshold), the idleness exceeds the threshold. Because mLatestBufferStorage is SYSTEM_MEMORY, latestStorage != storage evaluates to true, and SafeDelete(storage) destroys the STAGING object.

mMappedStorage is completely unaware of this deletion. A subsequent call to glUnmapBuffer will trigger the virtual function mMappedStorage->unmap(), resulting in a virtual call on a freed object.

Potential Reproduction Steps

Note: These are suggested steps based on static analysis. Our tooling does not yet execute code to provide a working proof-of-concept.

  1. From a compromised renderer process, establish a WebGL2/GLES3 context that uses the passthrough command decoder (default on Windows for ANGLE D3D11).
  2. Create a GL buffer and initialize it with GL_DYNAMIC_DRAW or GL_STREAM_DRAW. This sets the internal D3D usage to dynamic, forcing ANGLE to use SYSTEM_MEMORY as the mLatestBufferStorage.
  3. Compile a shader program that actively uses at least 9 uniform block bindings.
  4. Bind the buffer to all 9 uniform block binding points (glBindBufferBase(GL_UNIFORM_BUFFER, 0 through 8)).
  5. Map the buffer for reading via MapBufferRange with GL_MAP_READ_BIT. ANGLE allocates STAGING storage and points mMappedStorage to it.
  6. Issue a DrawArrays command. ANGLE fails to validate that the UBO is mapped, allowing the draw to proceed.
  7. The loop in syncUniformBuffersForShader fetches the storage for each of the 9 bindings, calling garbageCollection 9 times.
  8. On the 9th iteration, mIdleness[STAGING] reaches 9, exceeding the threshold of 8. The STAGING storage is SafeDeleted.
  9. (Optional) Spray the GPU process heap to reclaim the freed NativeStorage object and counterfeit its vtable.
  10. Unmap the buffer (glUnmapBuffer). The GPU process executes mMappedStorage->unmap(), dereferencing the attacker's payload and achieving Remote Code Execution in the GPU process.

Suggested Fix

There are multiple ways to address this issue:

  1. Prevent Deallocation of Mapped Storage: Update Buffer11::checkForDeallocation to explicitly prevent deleting the storage if it is currently mapped:
    C++
    if (storage != nullptr && storage != mMappedStorage && mIdleness[usage] > mDeallocThresholds[usage]) {
        // ... existing deletion logic ...
    }
    
  2. Validate UBO Mapped State: Update ANGLE's top-level API validation (e.g., ValidateProgramDrawStates) to return an error (like kBufferMapped) if any active Uniform Buffer Object is currently mapped, bringing UBOs in line with vertex and index buffer validation.
  3. Modernize Pointers: ANGLE relies extensively on raw pointers. Migrating ANGLE's pointers (like mMappedStorage) to base::raw_ptr would mitigate the exploitability of this and similar UAFs by transforming them into safe, non-exploitable crashes via MiraclePtr/BackupRefPtr.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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 combination of a priority inversion that leaves the mapped storage pointer dangling and missing validation that uniform buffers are not mapped during draw calls, allowing garbage collection to free the staging storage.

Impact

An attacker with a compromised renderer could potentially execute arbitrary code in the GPU process, though the report notes the reproduction steps are based on static analysis and no working proof-of-concept was executed.

What the attacker needed

Compromised renderer process; Windows with ANGLE D3D11 backend; shader with at least 9 uniform blocks

The fix

The report suggests preventing deallocation of mapped storage, validating that uniform buffers are not mapped during draw calls, and migrating raw pointers to safe pointer types; it does not state that a fix was applied.

How it was found

  1. From a compromised renderer, create a WebGL2/GLES3 context using the passthrough command decoder.
  2. Create a GL buffer with dynamic or stream draw usage so its latest storage is system memory.
  3. Compile a shader that uses at least nine uniform block bindings.
  4. Bind the buffer to all nine uniform block binding points.
  5. Map the buffer for reading, which allocates staging storage and sets the mapped storage pointer.
  6. Issue a draw call; the uniform buffer sync loop triggers garbage collection and frees the staging storage.

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 is a bug where a program keeps a pointer to memory after that memory has been freed, so later use can run attacker-controlled data. Here, a graphics buffer's temporary copy is deleted while still in use, and a later unmap call jumps through the freed object. An attacker who already controls the renderer process could use this to run code in the more privileged GPU 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.