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

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.cpp
  • third_party/angle/src/libANGLE/validationES3.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
  • third_party/angle/src/libANGLE/validationES.cpp
  • third_party/angle/src/libANGLE/validationES2.cpp
  • gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
  • gpu/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:

  1. Validation Omission: ValidateResumeTransformFeedback (in third_party/angle/src/libANGLE/validationES3.cpp) does not verify that the currently bound program matches the program that was active when glBeginTransformFeedback was 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.
  2. Incomplete Cleanup: TransformFeedbackVk::end() (in third_party/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp) correctly detaches observer bindings (mBufferObserverBindings.reset()) but fails to clear the aggressively cached Vulkan handles in mBufferHandles, mBufferOffsets, and mBufferSizes. Consequently, if a buffer is reallocated (e.g., via glBufferData), the cached handle and offset become stale because the observer that would normally trigger a cache update (onSubjectStateChange) has been removed.
  3. Missing Refresh on Resume: TransformFeedbackVk::resume() skips the call to initializeXFBVariables() when the native VK_EXT_transform_feedback extension is used (i.e., contextVk->getFeatures().emulateTransformFeedback.enabled is 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:

  1. Setup: Bind 4 buffers using glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, i, buffer[i]) for indices 0 to 3.
  2. Use Program A: glUseProgram(progA) where progA is compiled to output 4 separate-attribs XFB varyings.
  3. Begin TF: glBeginTransformFeedback(GL_POINTS). TransformFeedbackVk resolves all 4 buffers, binds observers, and caches their raw VkBuffer handles into mBufferHandles[0..3].
  4. End TF: glEndTransformFeedback(). The observers are reset, but the cached handles in mBufferHandles are not cleared.
  5. Reallocate Buffer: Call glBufferData on the buffers bound to indices 2 and 3. This causes BufferVk to release the old Vulkan suballocation and acquire a new one. The stale cache in TransformFeedbackVk is not updated because the observers were removed in step 4.
  6. Use Program B: glUseProgram(progB) where progB is compiled to output only 2 separate-attribs XFB varyings.
  7. Begin TF: glBeginTransformFeedback(GL_POINTS). Because progB only has 2 outputs, only slots 0 and 1 of the cache are refreshed. Slots 2 and 3 remain stale from the first session.
  8. Pause TF: glPauseTransformFeedback().
  9. Switch Program: glUseProgram(progA). This is permitted by ValidateUseProgram because TF is active but paused.
  10. Resume TF: glResumeTransformFeedback(). Validation passes because ValidateResumeTransformFeedback incorrectly omits the check for program identity. The Vulkan backend resume() skips the cache refresh on the native Vulkan path.
  11. Execute: glDrawArrays(GL_POINTS, 0, N). The dirty bits handler (ContextVk::handleDirtyGraphicsTransformFeedbackBuffersExtension) queries progA for the buffer count (which is 4). It retrieves the mBufferHandles array 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:

  1. Enforce Validation: Update ValidateResumeTransformFeedback in third_party/angle/src/libANGLE/validationES3.cpp to correctly enforce the GLES 3.0 specification. It must check that the currently bound program matches the program that was active when glBeginTransformFeedback was called (stored in the TransformFeedback object).
  2. Clear Stale Caches: Update TransformFeedbackVk::end() in third_party/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp to explicitly clear mBufferHandles, mBufferOffsets, and mBufferSizes when it resets the observer bindings.
  3. Ensure Safe Resume: Consider modifying TransformFeedbackVk::resume() to refresh the cache (by calling initializeXFBVariables()) 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.

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 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

  1. Bind four buffers as transform feedback buffers.
  2. Use a program that outputs four transform feedback varyings and begin transform feedback.
  3. End transform feedback, then reallocate two of the bound buffers.
  4. Use a program with only two outputs and begin transform feedback again.
  5. Pause, switch back to the four-output program, and resume.
  6. 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.

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.