Use after free in WebGL (CVE-2026-13032)
An incorrect order of operations in the GPU command decoder deletes a temporary framebuffer object while it is still bound, which on Android devices with PowerVR GPUs triggers a driver bug leading to a use-after-free in the GPU process. An attacker could potentially exploit this via malicious WebGL content to achieve code execution in the unsandboxed GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 11 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: An incorrect order of operations in GLES2DecoderImpl::ClearLevelUsingGL deletes a temporary Framebuffer Object (FBO) while it is actively bound. On Android devices with PowerVR GPUs, restoring the previous FBO subsequently triggers a driver bug, leading to a Use-After-Free (UAF) in the GPU process. This can be reached from malicious WebGL content.
Affected files:
gpu/command_buffer/service/gles2_cmd_decoder.cc
Estimated timestamp from git blame: Unknown (Google3 checkout)
Background
In the validating command decoder, GLES2DecoderImpl::ClearLevelUsingGL is used to clear uninitialized texture levels. It achieves this by creating a temporary Framebuffer Object (FBO), binding it, attaching the texture, clearing it, and then tearing down the temporary FBO.
Certain Imagination (PowerVR) GPU drivers contain a bug where they retain internal references to the 'currently bound' or 'previously bound' FBO across state transitions. To mitigate this, Chrome implements the ensure_previous_framebuffer_not_deleted workaround (enabled in gpu_driver_bug_list.json for Imagination.*). This workaround wraps FBO binding operations inside GLES2DecoderImpl::BindFramebuffer to ensure a known-good internal FBO (complete_fbo_) is bound during transitions, preventing the driver from accessing deleted state.
The Vulnerability
An incorrect sequence of OpenGL calls in GLES2DecoderImpl::ClearLevelUsingGL defeats this workaround, creating a condition that triggers the PowerVR driver bug.
The vulnerable code flow in gpu/command_buffer/service/gles2_cmd_decoder.cc is as follows:
- A temporary FBO
fbis created and bound using theBindFramebufferwrapper. - The uninitialized texture is attached and cleared using
glClearFn. - The flaw:
api()->glDeleteFramebuffersEXTFn(1, &fb)is called whilefbis still the currently bound FBO on the GL context. - Although the OpenGL ES spec mandates that deleting the bound FBO implicitly binds FBO 0, the buggy PowerVR driver fails to completely update its internal FBO state, leaving a dangling pointer to the now-freed
fb. - Immediately after deletion,
BindFramebuffer(fb_target, fb_service_id)is called to restore the original FBO binding. - Inside the
BindFramebufferwrapper, the PowerVR workaround triggers, attempting to bind the internalcomplete_fbo_first. - This state transition from the deleted
fbtocomplete_fbo_causes the driver to access its dangling pointer representing the previously bound FBO, resulting in a Use-After-Free (UAF).
Because the GPU process is unsandboxed on Android devices, memory corruption in the driver can lead to a direct sandbox escape.
Potential Attacker Steps (Theoretical)
Note: These are suggested theoretical steps as our tooling agent cannot execute code to verify a full chain.
- Heap Grooming: The attacker manipulates the GPU process heap via WebGL, creating and freeing FBOs or other driver objects to prepare the memory layout.
- Trigger Allocation: The attacker allocates a depth texture using WebGL (e.g.,
texImage2Dwithnulldata) on an ES2 context. - Trigger the Clear: The attacker issues a WebGL draw call (e.g.,
drawArrays) that relies on the uninitialized depth texture. The validation command decoder will intercept this and force a clear of the texture, invokingClearLevelUsingGL. - Exploitation: The driver dereferences the freed FBO state during the subsequent
BindFramebuffercall. If the freed memory has been replaced by attacker-controlled data, this can lead to code execution in the GPU process.
Recommended Fix
The restoration of the original FBO binding must occur before the temporary FBO is deleted. This ensures the driver transitions its internal state away from the temporary FBO while the FBO is still validly allocated, allowing the ensure_previous_framebuffer_not_deleted workaround to function correctly.
// gpu/command_buffer/service/gles2_cmd_decoder.cc - GLES2DecoderImpl::ClearLevelUsingGL
RestoreClearState();
// 1. Restore the old binding first
Framebuffer* framebuffer = GetFramebufferInfoForTarget(fb_target);
GLuint fb_service_id =
framebuffer ? framebuffer->service_id() : GetBackbufferServiceId();
BindFramebuffer(fb_target, fb_service_id);
// 2. Now it is safe to delete the temporary FBO
api()->glDeleteFramebuffersEXTFn(1, &fb);
return result;
Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb
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.
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
The code deletes a temporary framebuffer object before restoring the previous framebuffer binding, defeating a workaround for a PowerVR driver bug that retains references to deleted framebuffers.
Impact
Because the GPU process is unsandboxed on Android devices, memory corruption in the driver can lead to a direct sandbox escape, potentially allowing code execution.
What the attacker needed
Android device with PowerVR GPU; Victim visits malicious WebGL page
The fix
The restoration of the original FBO binding should occur before the temporary FBO is deleted, so the driver transitions its internal state while the FBO is still valid.
How it was found
- Manipulate the GPU process heap via WebGL to prepare memory layout.
- Allocate a depth texture using WebGL with null data on an ES2 context.
- Issue a WebGL draw call that relies on the uninitialized depth texture, forcing a clear that invokes ClearLevelUsingGL.
- The driver dereferences the freed FBO state during the subsequent BindFramebuffer call, potentially leading to code execution.
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 type of memory bug where a program keeps using a piece of memory after it has been freed, which can let an attacker control what happens next. Here, a graphics driver on some Android phones mishandles a sequence of OpenGL calls, leaving a dangling reference that could be exploited through a malicious WebGL page to run 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.