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

Use after free in GPU (CVE-2026-13775)

A use-after-free exists in CompoundImageBacking::GetOrAllocateBacking when a raw pointer to a SharedImageBackingFactory escapes a lock and is later used after the factory is destroyed by the GPU main thread. An attacker with a compromised renderer could potentially achieve remote code execution in the GPU process, and on Android this could lead to a full sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

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

Overview: A Time-of-Check Time-of-Use (TOCTOU) Use-After-Free exists in CompoundImageBacking::GetOrAllocateBacking when the kUseDynamicBackingAllocations feature is enabled. A raw SharedImageBackingFactory* pointer escapes a lock and can be used after the factory is destroyed by the GPU main thread, potentially leading to Remote Code Execution in the GPU process.

Affected files:

  • gpu/command_buffer/service/shared_image/compound_image_backing.cc
  • gpu/command_buffer/service/shared_image/compound_image_backing.h
  • gpu/command_buffer/service/shared_image/shared_image_factory.cc
  • gpu/command_buffer/service/shared_image/shared_image_factory.h

Estimated timestamp from git blame: 2026-05-07

Summary

A Time-of-Check Time-of-Use (TOCTOU) Use-After-Free vulnerability exists in CompoundImageBacking::GetOrAllocateBacking. When the kUseDynamicBackingAllocations feature is enabled (which is enabled by default via Finch), a background thread (e.g., the DrDC compositor thread) can attempt to dynamically allocate a new backing. During this process, a raw pointer to a SharedImageBackingFactory escapes a lock. If the renderer closes its GPU channel concurrently, the SharedImageFactory and its associated SharedImageBackingFactory objects are destroyed on the GPU main thread, leading to a UAF when the compositor thread subsequently dereferences the dangling pointer.

Because the GPU process is unsandboxed on Android, this could potentially lead to a full sandbox escape directly from a compromised renderer.

Technical Details

CompoundImageBacking holds a reference to a SharedImageFactory via scoped_refptr<SharedImageFactoryRef> shared_image_factory_;. When GetOrAllocateBacking is called on a background thread and dynamic allocation is required, the following sequence occurs:

  1. At compound_image_backing.cc:1854, a local raw pointer SharedImageBackingFactory* gpu_backing_factory = nullptr; is declared on the stack.
  2. The thread calls shared_image_factory_->Execute(...) to safely interact with the factory under a lock.
  3. Inside the lambda, factory->GetFactoryByUsage(...) is called, which returns a raw pointer to a heap-allocated SharedImageBackingFactory.
  4. This raw pointer is assigned to the local gpu_backing_factory variable.
  5. The Execute method finishes and releases its lock. The raw pointer gpu_backing_factory has now successfully escaped the protected scope.

Potential Exploitation Steps

An attacker with a compromised renderer could trigger this race condition by performing the following steps:

  1. Request access to a shared image on a background thread (e.g., DrDC) with an access stream that forces dynamic allocation.
  2. Concurrently, forcefully close the renderer's GPU channel.
  3. The GPU channel closure triggers the destruction of SharedImageStub and SharedImageFactory on the GPU main thread.
  4. The SharedImageFactory destructor destroys the std::vector<std::unique_ptr<SharedImageBackingFactory>> factories_, freeing the heap memory pointed to by gpu_backing_factory.
  5. The attacker uses heap spraying in the GPU process to reclaim the freed memory chunk with a crafted payload containing a fake vtable and a fake WeakReferenceOwner state.
  6. Execution resumes on the background thread. At compound_image_backing.cc:1863, the code calls gpu_backing_factory->GetWeakPtr() on the dangling pointer.
  7. GetWeakPtr reads ptr_ and flag_ from the attacker-controlled memory. By crafting a valid flag_, the attacker ensures the WeakPtr appears valid.
  8. The forged WeakPtr is passed to CreateBackingFromBackingFactory, which calls the virtual method factory->CreateSharedImage(...) (compound_image_backing.cc:1928).
  9. The virtual dispatch reads the fake vtable pointer, hijacking control flow and resulting in RCE in the GPU process.

Note: These are potential exploitation steps based on code analysis; we do not have a working proof-of-concept yet.

MiraclePtr Exemption

Because gpu_backing_factory is a raw pointer stored as a local stack variable, it is explicitly not protected by MiraclePtr (base::raw_ptr<T>).

Suggested Fix

The raw SharedImageBackingFactory* pointer should never escape the lock held by SharedImageFactoryRef::Execute.

One potential fix is to move the actual CreateSharedImage call into the lambda executed by Execute, so that the SharedImageBackingFactory is only accessed while the lock is held. The lambda can then return the resulting std::unique_ptr<SharedImageBacking> instead of the factory pointer.

Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955


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, a raw pointer to a SharedImageBackingFactory is obtained inside a locked scope but used after the lock is released, allowing the factory to be destroyed concurrently.

Impact

This could potentially lead to remote code execution in the GPU process, and because the GPU process is unsandboxed on Android, it could potentially lead to a full sandbox escape from a compromised renderer.

What the attacker needed

Compromised renderer; kUseDynamicBackingAllocations enabled; race condition timing

The fix

The raw pointer should never escape the lock; one potential fix is to move the CreateSharedImage call inside the lambda executed by Execute so the factory is only accessed while the lock is held.

How it was found

  1. Request access to a shared image on a background thread with an access stream that forces dynamic allocation.
  2. Concurrently, forcefully close the renderer's GPU channel.
  3. The GPU channel closure triggers destruction of SharedImageStub and SharedImageFactory on the GPU main thread.
  4. The SharedImageFactory destructor frees the factories vector, freeing the memory pointed to by the raw pointer.
  5. The attacker uses heap spraying to reclaim the freed memory with a crafted payload containing a fake vtable and fake WeakReferenceOwner state.
  6. Execution resumes on the background thread and calls GetWeakPtr on the dangling pointer, leading to virtual dispatch through the fake vtable.

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 after that memory has been freed, and then uses it again. Here, a background thread gets a pointer to a factory object, but before it uses it, another thread destroys that object, so the pointer points to freed memory. An attacker who controls the freed memory could make the program execute their code.

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.