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

Use after free in ANGLE (CVE-2026-17718)

A heap-use-after-free exists in ANGLE's Vulkan backend because VertexArrayVk caches raw pointers to BufferHelper objects that can be destroyed during DynamicBuffer resizing. An attacker could trigger this via WebGL to achieve memory corruption in the GPU process, potentially leading to full system compromise on Android where the GPU process is unsandboxed.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 50 days

Flapjack, 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: A potential heap-use-after-free vulnerability exists in ANGLE's Vulkan backend because VertexArrayVk caches raw pointers to vk::BufferHelper objects that can be destroyed during DynamicBuffer resizing. If a previously streamed attribute is inactive in a subsequent draw call, its cached pointer is not updated, leaving a dangling pointer. When vertex buffers are synchronized, iterating up to the maximum active attribute index causes the dangling pointer to be dereferenced.

Affected files:

  • third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.h

Estimated timestamp from git blame: 2025-09-22

Technical Details

A potential heap-use-after-free (UAF) vulnerability has been identified in the Vulkan backend of ANGLE. The issue stems from VertexArrayVk maintaining dangling raw pointers to vk::BufferHelper objects that have been destroyed.

Root Cause Analysis

In ANGLE's Vulkan backend, VertexArrayVk caches pointers to vertex buffer helpers in its mCurrentArrayBuffers array. For vertex attributes that use client-side memory streaming, these BufferHelper objects are dynamically allocated from ContextVk::mStreamedVertexBuffers.

While WebGL normally restricts client-side memory pointers, an attacker can force ANGLE to use client-side streaming by enabling the ANGLE_instanced_arrays extension and setting a vertexAttribDivisor that exceeds the Vulkan backend's maximum limit (which is capped at 255). This flags the attribute for divisor emulation via streaming.

The vulnerability occurs due to a lifecycle mismatch between the DynamicBuffer managing the memory and the cached pointers in VertexArrayVk:

  1. Dynamic Buffer Resizing: When ContextVk::mStreamedVertexBuffers needs more space, it pushes old BufferHelper blocks to an in-flight list. After a GPU flush, these blocks move to a free list. If the block size needs to change significantly, DynamicBuffer::allocate clears the free list, deleting the BufferHelper C++ objects and freeing their memory.
  2. Partial Synchronization: Before a draw call, VertexArrayVk::updateStreamedAttribs updates the cached pointers in mCurrentArrayBuffers. However, it only updates attributes that are both enabled and active in the current shader program (mStreamingVertexAttribsMask & activeAttribs).
  3. Dangling Pointer: If a VAO has a streamed attribute (e.g., Attribute 0) that was previously cached, but the current draw call uses a shader program where Attribute 0 is inactive, updateStreamedAttribs skips it. If the underlying BufferHelper was destroyed by another VAO causing a resize, mCurrentArrayBuffers[0] now contains a dangling pointer.
  4. UAF Trigger: ContextVk::handleDirtyGraphicsVertexBuffersVertexInputDynamicStateDisabled calls mRenderPassCommands->buffersVertexAttribRead(..., maxAttrib), where maxAttrib is the maximum active attribute location. If Attribute 1 is active, maxAttrib is at least 2. The function iterates from 0 to maxAttrib - 1, dereferencing the dangling pointer at index 0 to call bufferRead, resulting in a UAF.

Potential Trigger Steps

Note: Our tooling agent does not run code, so these are suggested steps based on static analysis.

  1. Create a WebGL context with the ANGLE_instanced_arrays extension.
  2. Create and bind vao1. Bind a WebGL buffer, enable Attribute 0 and Attribute 1, and configure them.
  3. Call gl.vertexAttribDivisor(0, 0xFFFFFFFF) to force Attribute 0 into client-side streaming emulation.
  4. Draw using programA (which uses both attributes). ANGLE allocates a BufferHelper and caches its pointer in vao1's mCurrentArrayBuffers[0].
  5. Create and bind vao2. Configure it identically to vao1 to use streaming on Attribute 0.
  6. Execute numerous, large draw calls using vao2. This exhausts the per-context DynamicBuffer block, pushing the original BufferHelper to the in-flight list.
  7. Force a GPU flush (e.g., gl.readPixels()), moving the BufferHelper to the free list.
  8. Execute another draw call with vao2 using a vastly different allocation size. DynamicBuffer::allocate resizes its blocks and clears the free list, destroying the original BufferHelper C++ object.
  9. Rebind vao1. The mCurrentArrayBuffers[0] pointer is now dangling.
  10. Draw using programB (which uses Attribute 1, but not Attribute 0).
  11. updateStreamedAttribs skips Attribute 0 because it is inactive. buffersVertexAttribRead iterates up to maxAttrib (which is >= 2), accessing index 0 and dereferencing the freed pointer.

Impact

This vulnerability can be triggered via WebGL, allowing a malicious website to achieve memory corruption in the GPU process. Because the GPU process is unsandboxed on Android, this could allow for a full system compromise.

Suggested Fix

To address this issue, VertexArrayVk::updateStreamedAttribs should ensure that all cached pointers in VertexArrayVk are reset to a safe fallback (such as ContextVk::mEmptyBuffer) if they are inactive but their underlying BufferHelper might have been invalidated. Alternatively, buffersVertexAttribRead could iterate over the active attribute mask instead of all indices up to maxAttrib.

Evaluated with Chrome root at commit: 2155cb00003ec35716a76ed3246eae995f87b7ff


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.

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, VertexArrayVk caches raw pointers to BufferHelper objects that can be destroyed when DynamicBuffer resizes, and updateStreamedAttribs only refreshes pointers for attributes that are active in the current shader, leaving inactive attributes with dangling pointers that are later dereferenced.

Impact

This vulnerability can be triggered via WebGL, allowing a malicious website to achieve memory corruption in the GPU process; because the GPU process is unsandboxed on Android, this could allow for a full system compromise.

What the attacker needed

Victim visits a malicious webpage; WebGL with ANGLE_instanced_arrays; Android for full system compromise

The fix

VertexArrayVk::updateStreamedAttribs should reset cached pointers to a safe fallback (such as ContextVk::mEmptyBuffer) if they are inactive but their underlying BufferHelper might have been invalidated, or buffersVertexAttribRead should iterate over the active attribute mask instead of all indices…

How it was found

  1. Create a WebGL context with the ANGLE_instanced_arrays extension.
  2. Create and bind vao1, bind a WebGL buffer, enable Attribute 0 and Attribute 1, and configure them.
  3. Call gl.vertexAttribDivisor(0, 0xFFFFFFFF) to force Attribute 0 into client-side streaming emulation.
  4. Draw using programA (which uses both attributes) so ANGLE allocates a BufferHelper and caches its pointer in vao1.
  5. Create and bind vao2, configure it identically to vao1, and execute numerous large draw calls to exhaust the DynamicBuffer block and push the original BufferHelper to the in-flight list.
  6. Force a GPU flush (e.g., gl.readPixels()) to move the BufferHelper to the free list, then execute another draw call with vao2 using a vastly different allocation size to resize blocks and destroy the original BufferHelper.

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 bug where a program keeps a pointer to memory after that memory has been freed, and later uses it as if it were still valid. Here, a WebGL page can cause the browser's graphics code to free a buffer object but leave a stale pointer to it, and then a later drawing operation reads through that stale pointer. This can corrupt memory in the GPU process, which on Android runs without a sandbox, so it could be serious.

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.