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
- 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.ccgpu/command_buffer/service/shared_image/compound_image_backing.hgpu/command_buffer/service/shared_image/shared_image_factory.ccgpu/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:
- At
compound_image_backing.cc:1854, a local raw pointerSharedImageBackingFactory* gpu_backing_factory = nullptr;is declared on the stack. - The thread calls
shared_image_factory_->Execute(...)to safely interact with the factory under a lock. - Inside the lambda,
factory->GetFactoryByUsage(...)is called, which returns a raw pointer to a heap-allocatedSharedImageBackingFactory. - This raw pointer is assigned to the local
gpu_backing_factoryvariable. - The
Executemethod finishes and releases its lock. The raw pointergpu_backing_factoryhas 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:
- Request access to a shared image on a background thread (e.g., DrDC) with an access stream that forces dynamic allocation.
- Concurrently, forcefully close the renderer's GPU channel.
- The GPU channel closure triggers the destruction of
SharedImageStubandSharedImageFactoryon the GPU main thread. - The
SharedImageFactorydestructor destroys thestd::vector<std::unique_ptr<SharedImageBackingFactory>> factories_, freeing the heap memory pointed to bygpu_backing_factory. - 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
WeakReferenceOwnerstate. - Execution resumes on the background thread. At
compound_image_backing.cc:1863, the code callsgpu_backing_factory->GetWeakPtr()on the dangling pointer. GetWeakPtrreadsptr_andflag_from the attacker-controlled memory. By crafting a validflag_, the attacker ensures theWeakPtrappears valid.- The forged
WeakPtris passed toCreateBackingFromBackingFactory, which calls the virtual methodfactory->CreateSharedImage(...)(compound_image_backing.cc:1928). - 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.
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
- Request access to a shared image on a background thread with an access stream that forces dynamic allocation.
- Concurrently, forcefully close the renderer's GPU channel.
- The GPU channel closure triggers destruction of SharedImageStub and SharedImageFactory on the GPU main thread.
- The SharedImageFactory destructor frees the factories vector, freeing the memory pointed to by the raw pointer.
- The attacker uses heap spraying to reclaim the freed memory with a crafted payload containing a fake vtable and fake WeakReferenceOwner state.
- 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.