Use after free in ANGLE (CVE-2026-9899)
ANGLE's Vulkan backend can reuse stale cached Vulkan buffer handles during transform feedback after a program switch and pause/resume cycle, because resume validation does not check that the bound program matches the one active at begin. A compromised renderer could send raw GLES3 commands to make the GPU write vertex shader output into freed or reallocated memory, causing memory corruption in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 60 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A vulnerability in ANGLE's Vulkan backend allows a compromised renderer to bypass transform feedback validation and cause the GPU to write data into stale or reallocated memory regions. This is caused by a failure to validate program consistency on resume and a failure to clear cached Vulkan buffer handles.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cppthird_party/angle/src/libANGLE/validationES3.cppthird_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cppthird_party/angle/src/libANGLE/validationES.cppthird_party/angle/src/libANGLE/validationES2.cppgpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.ccgpu/command_buffer/service/gles2_cmd_decoder.cc
Estimated timestamp from git blame: 2025-01-22
Description
An issue exists in ANGLE's Vulkan backend where stale VkBuffer handles and offsets can be reused during transform feedback (TF) operations after a program switch and a pause/resume cycle. This leads to an out-of-bounds write or use-after-free scenario on the GPU, where vertex shader output is DMA-written into memory regions that may have been reallocated for other purposes (such as indirect-draw buffers or uniform buffers).
The vulnerability stems from three interacting issues in validation logic and the Vulkan backend implementation:
- Validation Omission:
ValidateResumeTransformFeedback(inthird_party/angle/src/libANGLE/validationES3.cpp) does not verify that the currently bound program matches the program that was active whenglBeginTransformFeedbackwas called. This violates the GLES 3.0 specification (§2.15.2) and allows a paused TF object to be resumed with a completely different program. - Incomplete Cleanup:
TransformFeedbackVk::end()(inthird_party/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp) correctly detaches observer bindings (mBufferObserverBindings.reset()) but fails to clear the aggressively cached Vulkan handles inmBufferHandles,mBufferOffsets, andmBufferSizes. Consequently, if a buffer is reallocated (e.g., viaglBufferData), the cached handle and offset become stale because the observer that would normally trigger a cache update (onSubjectStateChange) has been removed. - Missing Refresh on Resume:
TransformFeedbackVk::resume()skips the call toinitializeXFBVariables()when the nativeVK_EXT_transform_feedbackextension is used (i.e.,contextVk->getFeatures().emulateTransformFeedback.enabledis false). This prevents the stale cache from being refreshed during the resume operation.
While Blink includes renderer-side validation to prevent resuming with the wrong program, the GPU process's command decoders (e.g., GLES2DecoderImpl::DoResumeTransformFeedback) forward the ResumeTransformFeedback command to ANGLE without performing equivalent program identity checks. This allows a compromised renderer to bypass the check entirely.
Potential Reproduction Steps
The following sequence outlines how a compromised renderer could theoretically trigger the vulnerability by sending raw GLES3 commands to the GPU process on a platform using ANGLE's Vulkan backend with native transform feedback support:
- Setup: Bind 4 buffers using
glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, i, buffer[i])for indices 0 to 3. - Use Program A:
glUseProgram(progA)whereprogAis compiled to output 4 separate-attribs XFB varyings. - Begin TF:
glBeginTransformFeedback(GL_POINTS).TransformFeedbackVkresolves all 4 buffers, binds observers, and caches their rawVkBufferhandles intomBufferHandles[0..3]. - End TF:
glEndTransformFeedback(). The observers are reset, but the cached handles inmBufferHandlesare not cleared. - Reallocate Buffer: Call
glBufferDataon the buffers bound to indices 2 and 3. This causesBufferVkto release the old Vulkan suballocation and acquire a new one. The stale cache inTransformFeedbackVkis not updated because the observers were removed in step 4. - Use Program B:
glUseProgram(progB)whereprogBis compiled to output only 2 separate-attribs XFB varyings. - Begin TF:
glBeginTransformFeedback(GL_POINTS). BecauseprogBonly has 2 outputs, only slots 0 and 1 of the cache are refreshed. Slots 2 and 3 remain stale from the first session. - Pause TF:
glPauseTransformFeedback(). - Switch Program:
glUseProgram(progA). This is permitted byValidateUseProgrambecause TF is active but paused. - Resume TF:
glResumeTransformFeedback(). Validation passes becauseValidateResumeTransformFeedbackincorrectly omits the check for program identity. The Vulkan backendresume()skips the cache refresh on the native Vulkan path. - Execute:
glDrawArrays(GL_POINTS, 0, N). The dirty bits handler (ContextVk::handleDirtyGraphicsTransformFeedbackBuffersExtension) queriesprogAfor the buffer count (which is 4). It retrieves themBufferHandlesarray and binds all 4 handles to the Vulkan pipeline (vkCmdBindTransformFeedbackBuffersEXT).
The GPU then DMA-writes the vertex shader output for slots 2 and 3 into the physical memory regions pointed to by the stale handles. If the attacker groomed the GPU memory, these freed suballocations could have been reallocated for a victim buffer, leading to arbitrary memory corruption within the highly privileged GPU process context. MiraclePtr offers no protection here, as this is a GPU memory issue.
Suggested Fix
To remediate this issue, the following changes are recommended:
- Enforce Validation: Update
ValidateResumeTransformFeedbackinthird_party/angle/src/libANGLE/validationES3.cppto correctly enforce the GLES 3.0 specification. It must check that the currently bound program matches the program that was active whenglBeginTransformFeedbackwas called (stored in theTransformFeedbackobject). - Clear Stale Caches: Update
TransformFeedbackVk::end()inthird_party/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cppto explicitly clearmBufferHandles,mBufferOffsets, andmBufferSizeswhen it resets the observer bindings. - Ensure Safe Resume: Consider modifying
TransformFeedbackVk::resume()to refresh the cache (by callinginitializeXFBVariables()) even when native transform feedback is used, to ensure the backend state accurately reflects the current bindings.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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 combination of missing program-identity validation on resume, cached Vulkan buffer handles not being cleared when transform feedback ends, and the resume path skipping cache refresh on the native Vulkan extension path.
Impact
A compromised renderer could cause an out-of-bounds write or use-after-free in GPU memory, potentially leading to arbitrary memory corruption within the privileged GPU process; the text notes Blink's renderer-side check blocks the wrong-program resume, so the attack requires bypassing it.
What the attacker needed
Compromised renderer; ANGLE Vulkan backend; native transform feedback extension
The fix
The text recommends enforcing program-identity validation on resume, clearing the cached handles when transform feedback ends, and refreshing the cache on resume; it does not say the issue was fixed.
How it was found
- Bind four buffers as transform feedback buffers.
- Use a program that outputs four transform feedback varyings and begin transform feedback.
- End transform feedback, then reallocate two of the bound buffers.
- Use a program with only two outputs and begin transform feedback again.
- Pause, switch back to the four-output program, and resume.
- Draw, causing the GPU to write into the stale buffer locations.
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.
Transform feedback is a graphics feature where a program writes its output into buffers you choose. The code kept a note of where those buffers lived in GPU memory, but after the buffers were replaced it never updated that note, so later output was written to the old, now-reused location. Because the GPU process is trusted, this could let someone who already controls the renderer corrupt memory there.
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.