Use after free in ANGLE (CVE-2026-7359)
A use-after-free write vulnerability exists in the GPU process passthrough command decoder due to service ID recycling in ANGLE and incorrect client ID resolution for orphaned buffers. A compromised renderer could force a service ID collision to poison the decoder's mapping state and write arbitrary data into freed GPU memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 35 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A Use-After-Free (UAF) Write vulnerability potentially exists in the GPU process passthrough command decoder due to service ID recycling in ANGLE and incorrect client ID resolution for orphaned buffers. A compromised renderer can force a service ID collision between an orphaned buffer and a new buffer, poisoning the passthrough decoder's mapping state to write arbitrary data into freed GPU memory.
Affected files:
gpu/command_buffer/service/gles2_cmd_decoder_passthrough.ccgpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.ccgpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
Estimated timestamp from git blame: 2025-11-28
Summary
A potential Use-After-Free (UAF) Write vulnerability exists in GLES2DecoderPassthroughImpl. The issue occurs because of a service ID collision when a buffer is orphaned by a Vertex Array Object (VAO). When a buffer is deleted while bound to a non-current VAO, ANGLE immediately recycles its service ID handle even though the buffer object itself remains alive (orphaned). This allows a newly generated buffer to inherit the same service ID. If the orphaned VAO is subsequently used, the passthrough decoder incorrectly attributes the orphan's mapped memory to the new buffer's client ID. This results in a poisoned entry in mapped_buffer_map containing a dangling pointer that can be used to perform arbitrary writes to freed GPU memory when the new buffer is flushed.
Theoretical Exploit Steps
(Note: This is a potential vulnerability identified via static analysis by an AI agent; a working proof-of-concept exploit has not been executed).
A compromised renderer process can potentially trigger this vulnerability using the following sequence of command buffer operations:
- Establish the Orphan: The renderer creates VAO 1 (
client_vao_1) and Buffer A (client_buf_A). The decoder queries ANGLE for a service ID, receivingservice_A. The decoder mapsclient_buf_A<->service_Ainresources_->buffer_id_map. - The renderer binds VAO 1 and then binds Buffer A to the
GL_ELEMENT_ARRAY_BUFFERtarget. VAO 1 now holds a strong reference to Buffer A in ANGLE. - The renderer unbinds VAO 1 (it is no longer the active VAO) and deletes Buffer A (
glDeleteBuffers(1, &client_buf_A)). - In
DoDeleteBuffers, the decoder removes the mapping forclient_buf_Aand calls ANGLE'sglDeleteBuffers(1, &service_A). Because Buffer A is not bound to the current context, ANGLE'sContext::deleteBufferimmediately releases the IDservice_Aback to the allocator. However, because VAO 1 still references Buffer A, its reference count is > 0, so the underlying driver memory is not destroyed. Buffer A is now an "orphan." - Force Collision: The renderer immediately creates a new Buffer B (
glGenBuffers(1, &client_buf_B)). ANGLE recycles and returns the IDservice_A. The decoder maps the newclient_buf_B<->service_A. - Poison Mapping State: The renderer re-binds VAO 1, setting
bound_element_array_buffer_dirty_ = truein the decoder. - The renderer sends a
glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, ...)command.DoMapBufferRangeexecutes and successfully maps the actual underlying buffer (the orphaned Buffer A) via ANGLE, returningmapped_ptr. DoMapBufferRangethen callsLazilyUpdateCurrentlyBoundElementArrayBuffer(). This queries ANGLE forGL_ELEMENT_ARRAY_BUFFER_BINDING. ANGLE inspects the bound VAO 1 and returns the original service ID of its attached buffer:service_A.- The decoder performs a reverse-lookup:
GetClientID(&resources_->buffer_id_map, service_A, ...). Becauseservice_Awas recycled, this incorrectly resolves to the client ID of the new buffer:client_buf_B. The decoder updates its tracking:bound_buffers_[GL_ELEMENT_ARRAY_BUFFER] = client_buf_B. DoMapBufferRangeinsertsmapped_ptrintoresources_->mapped_buffer_mapunder the keyclient_buf_B. The decoder now believes Buffer B is mapped, but the pointer actually points to the driver memory of the orphan Buffer A.- Trigger UAF Write: The renderer deletes VAO 1 (
glDeleteVertexArraysOES). VAO 1 drops its reference to the orphan Buffer A. Buffer A is destroyed by ANGLE, and the graphics driver frees the backing memory. Themapped_ptrstored underclient_buf_Bis now a dangling pointer. - The renderer binds Buffer B to
GL_ARRAY_BUFFERand invokesglFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, size). DoFlushMappedBufferRangeretrieves the poisonedmap_infoforclient_buf_Band executes an unconstrainedmemcpyfrom an attacker-controlled shared memory segment into the danglingmap_ptr.
Impact
This vulnerability provides a robust write-what-where primitive in the GPU process. Because the memory is allocated and managed by the underlying graphics driver (e.g., Vulkan/D3D11) rather than Chromium's PartitionAlloc, MiraclePtr (BackupRefPtr) does not protect this pointer. An attacker can leverage this primitive to overwrite reused GPU structures (such as command buffers, shaders, or descriptors) to achieve Code Execution in the GPU process, resulting in a renderer-to-GPU sandbox escape.
Suggested Fix
The core issue is that the passthrough decoder relies on a reverse-lookup (GetClientID) using a service ID that may have been recycled by ANGLE while the underlying buffer object remains alive as an orphan.
Potential fixes include:
- Preventing ID Recycling in ANGLE: Modify ANGLE's
HandleAllocatorto prevent the immediate reuse of a service ID if the underlyingRefCountObject(like aBuffer) still has a non-zero reference count (e.g., from an unbound VAO). - Tracking Orphans in the Decoder: The passthrough decoder could track orphaned buffers (buffers that have been deleted but might still be referenced by VAOs). If
glGetIntegervFn(GL_ELEMENT_ARRAY_BUFFER_BINDING)returns an ID that belongs to an orphaned buffer, the decoder should handle it safely (e.g., by returning a pseudo-client ID or rejecting the mapping operation). - Validating Client IDs: In
LazilyUpdateCurrentlyBoundElementArrayBuffer(), add a verification step to ensure that the resolvedclient_element_array_bufferactually corresponds to the expected state of the currently bound VAO, rather than blindly trusting the reverse lookup of a potentially recycled service ID.
Evaluated with Chrome root at commit: a3f5fcb392f2902650ca2b71820e7e418787e18b
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. Please feel free to reach out to me if you have concerns or feedback.
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 the passthrough decoder relies on a reverse-lookup of a service ID that may have been recycled by ANGLE while the underlying buffer object remains alive as an orphan.
Impact
This vulnerability could provide a write-what-where primitive in the GPU process, potentially leading to code execution and a renderer-to-GPU sandbox escape.
What the attacker needed
Compromised renderer process
The fix
The issue should be fixed by preventing ID recycling in ANGLE, tracking orphaned buffers in the decoder, or validating client IDs during reverse lookup.
How it was found
- Create a VAO and a buffer, bind the buffer to the element array target of the VAO.
- Unbind the VAO and delete the buffer, causing its service ID to be recycled while the buffer remains orphaned.
- Create a new buffer that receives the same service ID.
- Re-bind the VAO and map the element array buffer, causing the decoder to associate the orphan's memory with the new buffer's client ID.
- Delete the VAO to free the orphaned buffer's memory, leaving a dangling pointer in the decoder's map.
- Bind the new buffer to the array buffer target and flush the mapped range, writing to the freed memory.
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.
This report describes a memory safety bug in a graphics component. When a buffer is deleted but still referenced elsewhere, its identifier can be reused, causing the program to mix up old and new buffers. An attacker who controls part of the browser could then write data to memory that has already been freed, potentially leading to code execution.
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.