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

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

A use-after-free exists in ANGLE's parallel shader linking because a background linking task holds a raw reference to a destroyed Context's capabilities. An attacker with a compromised renderer could trigger this to achieve arbitrary code execution in the GPU process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 41 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. Please see go/chrome-ai-generated-security-bugs-faq for more information.

Overview: A potential Use-After-Free vulnerability exists in ANGLE's parallel shader linking when a background worker thread (MainLinkTask) holds a raw reference to a destroyed Context's capabilities. An attacker can trigger this by utilizing a shared context group and forcing context loss while an unbound program is linking in the background. This allows a compromised renderer to achieve arbitrary code execution in the GPU process.

Affected files:

  • third_party/angle/src/libANGLE/Program.cpp
  • third_party/angle/src/libANGLE/Context.cpp
  • gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
  • third_party/angle/src/libANGLE/State.h

Estimated timestamp from git blame: 2023-10-24

Summary

A potential Use-After-Free (UAF) vulnerability has been identified in ANGLE's parallel shader compilation logic. The MainLinkTask class, which handles background program linking, captures raw C++ references to the Caps and Limitations structures (const Caps &mCaps;) owned by the Context's inline PrivateState.

When a Context is destroyed, its PrivateState and the associated Caps memory are freed. However, Context::onDestroy only ensures that pending link tasks for the currently bound program (or pipeline) are explicitly joined. If a linking program is unbound and the context is destroyed, the background thread will continue executing and eventually dereference the freed Caps memory, resulting in a UAF.

Potential Trigger Steps

An attacker with a compromised renderer process could theoretically trigger this via the command buffer IPCs to the GPU process:

  1. Setup Shared Context: The attacker requests a GLES2 command buffer (creating Context A). They then send an IPC like CopySharedImageINTERNAL, which lazily initializes lazy_context_ in the passthrough decoder. This creates Context B, which explicitly shares the same ANGLE ShareGroup as Context A.
  2. Start Background Link: The attacker creates a shader program, attaches complex shaders (to prolong linking), and calls glLinkProgram. This creates a MainLinkTask that captures a reference to Context A's Caps and is dispatched to a background worker thread.
  3. Unbind Program: The attacker calls glUseProgram(0) to ensure the program is no longer currently bound to Context A.
  4. Force Context Teardown: The attacker sends a LoseContextCHROMIUM command and destroys the command buffer. Context A is destroyed.
  5. Bypass Link Resolution: Because the program is unbound, Context::onDestroy's call to mState.ensureNoPendingLink(this) ignores it, failing to join the background thread.
  6. Program Leakage: Context A is destroyed, freeing its Caps. However, Context B keeps the ShareGroup (and thus the ShaderProgramManager and the linking program) alive.
  7. UAF: The worker thread continues execution and accesses fields like caps.maxVertexAttributes from the freed memory.

Note: These are suggested steps based on source code analysis; our tooling agent cannot execute code to provide a live proof-of-concept.

Impact

By utilizing heap spraying techniques in the GPU process before Context A is fully destroyed, an attacker could potentially control the freed Caps memory. Modifying values like maxVertexAttributes bypasses bounds checks during linking (e.g., when populating usedAttribMap in Program::linkAttributes), leading to arbitrary out-of-bounds reads and writes. Because ANGLE is a third-party library without MiraclePtr protections, this UAF can be reliably exploited for a renderer-to-GPU sandbox escape.

Suggested Fix

  1. Capture by Value: Update MainLinkTask (and related structures) to capture Caps, Limitations, and Version by value rather than by reference. These structures are relatively small and copying them would guarantee the worker thread does not depend on the lifetime of the Context.
  2. Complete Thread Joining: Ensure that Context::onDestroy or ShaderProgramManager properly joins all background compilation/linking threads belonging to the context/share group upon destruction, even if the program is not currently bound.

Evaluated with Chrome root at commit: 661452647ddb2827305122ff3273bd5dea403f09


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 background linking task captures raw references to the Context's capabilities instead of copying them, and context destruction does not wait for unbound linking programs to finish.

Impact

An attacker with a compromised renderer could potentially control the freed memory via heap spraying and achieve arbitrary code execution in the GPU process, leading to a sandbox escape.

What the attacker needed

Compromised renderer process; ability to send GPU command buffer IPCs

The fix

The fix should capture the capabilities by value and ensure all background linking threads are joined on context destruction.

How it was found

  1. Create a shared context group by requesting a GLES2 command buffer and triggering lazy context creation.
  2. Start a background link by creating a program with complex shaders and calling glLinkProgram.
  3. Unbind the program with glUseProgram(0).
  4. Force context teardown by sending LoseContextCHROMIUM and destroying the command buffer.
  5. Because the program is unbound, the pending link is not joined and the background thread continues.
  6. The background thread accesses freed memory, causing a 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 using memory after it has been freed. Here, a background task that links shaders still points to data from a graphics context that has been destroyed. If an attacker can control what is placed in that freed memory, they could run their own code in the 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.