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

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

A heap-use-after-free exists in ANGLE's Vulkan backend because raw pointers to default vertex attribute buffers are cached and not cleared when the underlying buffer is resized and freed. An attacker who grooms the heap could forge a BufferHelper object and potentially achieve arbitrary code execution in the unsandboxed GPU process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 43 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 without the Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.

Overview: A potential heap-use-after-free exists in ANGLE's Vulkan backend due to dangling raw pointers in VertexArrayVk. When a DynamicBuffer resizes, old BufferHelper objects are deleted, but stale pointers remain cached in mCurrentArrayBuffers. Subsequent draw calls can dereference these pointers, providing an arbitrary memory increment primitive and potential driver-level exploitation.

Affected files:

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

Estimated timestamp from git blame: 2025-09-22

Summary

A potential heap-use-after-free (UAF) vulnerability has been identified in the ANGLE Vulkan backend. The issue originates from how default vertex attributes are cached. When a program uses an attribute that is disabled on the bound Vertex Array Object (VAO), ANGLE allocates a BufferHelper for the default value and stores a raw pointer to it in VertexArrayVk::mCurrentArrayBuffers. If the underlying DynamicBuffer is later forced to resize, the old BufferHelper objects are deleted from the heap during a command flush. However, the VertexArrayVk cache is not updated. A subsequent draw call can dereference this dangling pointer, allowing an attacker who grooms the heap to forge a BufferHelper object and achieve arbitrary code execution in the unsandboxed GPU process.

Technical Details

  1. Allocation: During ContextVk::setupDraw, if a program uses a disabled attribute A, VertexArrayVk::updateDefaultAttrib is called. This allocates memory via DynamicBuffer::allocate, returning a raw BufferHelper* which is cached in VertexArrayVk::mCurrentArrayBuffers[A].
  2. The Free: If the attacker forces the DynamicBuffer for attribute A to require a larger block size (e.g., via a large instanced draw call), the old BufferHelper is moved to an in-flight list. Upon a Vulkan command flush (ContextVk::flushAndSubmitCommands), DynamicBuffer::updateQueueSerialAndReleaseInFlightBuffers detects the size mismatch and clears the list. This destroys the std::unique_ptr holding the BufferHelper, calling operator delete on the heap object. The raw pointer in mCurrentArrayBuffers[A] is now dangling.
  3. The Use: The attacker issues a new draw call using a different program that does not use attribute A, but uses an attribute B where B > A. Because A is not active, updateDefaultAttrib is skipped, leaving the dangling pointer in place. However, ContextVk calls mRenderPassCommands->buffersVertexAttribRead(..., maxAttrib). Since the new program's maxAttrib is B + 1, the loop iterates over index A and dereferences the stale pointer, calling buffer->recordReadBarrier(...).

Impact and Exploitability

By grooming the heap, an attacker can replace the freed BufferHelper (approx 488 bytes) with controlled data. When recordReadBarrier is called on the forged object, it reads a forged mCurrentWriteEvent handle.

  1. Arbitrary Increment: The forged handle is passed to eventCollector->emplace_back, invoking RefCountedEvent's copy constructor, which calls mHandle->addRef(). This performs an atomic 32-bit increment (mRefCount++) at the attacker-supplied memory address.
  2. Driver-Level Execution: Later, when the event collector is cleared, the forged event's destructor calls vkDestroyEvent(device, mHandle->event, nullptr). Passing an attacker-controlled handle to the Vulkan driver can allow the attacker to free arbitrary driver memory or hijack execution, leading to full Remote Code Execution (RCE) in the GPU process. Note that the GPU process is unsandboxed on Android.

mCurrentArrayBuffers is a standard std::array of raw pointers, so it is not protected by MiraclePtr/BRP.

Potential Attacker Steps (Suggested)

Note: Our tooling agent does not have the ability to run code, these are suggested steps based on static analysis.

  1. Create a WebGL2 context and a VAO.
  2. Compile Program 1 (uses attribute 0) and Program 2 (uses attribute 1).
  3. Disable attribute 0 (glDisableVertexAttribArray(0)).
  4. Call glUseProgram(Program 1) and glDrawArrays(...) to cache a default BufferHelper pointer for attribute 0.
  5. Force a resize of the DynamicBuffer for attribute 0 (e.g., enable it, set a divisor, and draw a massive number of instances).
  6. Trigger a flush (e.g., glReadPixels) to free the old BufferHelper object.
  7. Groom the heap with controlled data to forge the BufferHelper structure at the freed location.
  8. Call glUseProgram(Program 2) and glDrawArrays(...) to trigger the UAF and execute the exploit primitives.

Suggested Fix

Replace the raw pointers in gl::AttribArray<vk::BufferHelper *> mCurrentArrayBuffers with a safer mechanism. Options include:

  • Using BackupRefPtr (e.g., base::raw_ptr<vk::BufferHelper>) to immediately mitigate the exploitability by turning the UAF into a safe crash.
  • Having VertexArrayVk observe the destruction of BufferHelper objects or strictly clearing mCurrentArrayBuffers for indices that are not active in the current program during setupDraw.

Evaluated with Chrome root at commit: c0eb5541aebfa4ea08806eaf6e94bcc69f87ab2f


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. 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, the raw pointers in VertexArrayVk::mCurrentArrayBuffers are not cleared when the corresponding BufferHelper objects are deleted during a DynamicBuffer resize, leaving dangling pointers that are later dereferenced.

Impact

An attacker who grooms the heap could forge a BufferHelper object and potentially achieve arbitrary code execution in the unsandboxed GPU process on Android.

What the attacker needed

WebGL2 support; Ability to run JavaScript in a browser; Heap grooming capability

The fix

The raw pointers in mCurrentArrayBuffers should be replaced with a safer mechanism such as BackupRefPtr or by clearing the cache for inactive attributes during setupDraw.

How it was found

  1. Create a WebGL2 context and a VAO.
  2. Compile Program 1 (uses attribute 0) and Program 2 (uses attribute 1).
  3. Disable attribute 0.
  4. Call glUseProgram(Program 1) and glDrawArrays to cache a default BufferHelper pointer for attribute 0.
  5. Force a resize of the DynamicBuffer for attribute 0 (e.g., enable it, set a divisor, and draw a massive number of instances).
  6. Trigger a flush (e.g., glReadPixels) to free the old BufferHelper object.

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.

When a program uses a vertex attribute that is turned off, the graphics driver creates a temporary buffer to hold a default value and keeps a pointer to it. If that buffer is later resized, the old buffer is freed but the pointer is not updated, so a later draw call uses memory that has already been freed. An attacker who can control what is placed in that freed memory could trick the driver into running their code.

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.