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

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

A validation gap in ANGLE's WebGL compatibility layer allows WebGL 2 contexts to map buffers and issue draw calls simultaneously. Drawing with an unaligned vertex attribute on a mapped buffer triggers an internal staging buffer reallocation, leaving a dangling pointer in the passthrough command decoder, which is subsequently written to during unmapping.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 50 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 security team.

Overview: A validation gap in ANGLE's WebGL compatibility layer allows WebGL 2 contexts to map buffers and issue draw calls simultaneously. Drawing with an unaligned vertex attribute on a mapped buffer triggers an internal staging buffer reallocation, leaving a dangling pointer in the passthrough command decoder, which is subsequently written to during unmapping.

Affected files:

  • third_party/angle/src/libANGLE/validationES.cpp
  • third_party/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp
  • gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc

Estimated timestamp from git blame: 2025-11-28

Description

There is a potential Use-After-Free (UAF) vulnerability in the GPU process when using the ANGLE-Vulkan backend with the passthrough command decoder. This issue allows a compromised renderer to write arbitrary data into freed memory managed by the Vulkan Memory Allocator (VMA), which is not protected by MiraclePtr, potentially leading to a sandbox escape.

Root Cause Analysis

The vulnerability stems from a combination of validation gaps and internal state mismanagement:

  1. Mapped Buffer Allowed in WebGL 2: The GLES2DecoderPassthroughImpl allows WebGL 2 contexts to issue MapBufferRange commands. ANGLE's ValidateMapBufferRangeBase does not block this for WebGL contexts. The decoder allocates a host-visible staging buffer in VMA and caches its raw pointer in MappedBuffer::map_ptr.
  2. Draw Validation Bypass: Normally, OpenGL forbids drawing from a buffer while it is mapped. However, in third_party/angle/src/libANGLE/validationES.cpp:4044 (ValidateDrawStates), the check vertexArray->hasInvalidMappedArrayBuffer() is skipped if extensions.webglCompatibilityANGLE is true. Because this is a WebGL context, the extension is enabled, allowing the draw call to proceed despite the buffer being mapped.
  3. Internal Reallocation: If the draw call uses an unaligned vertex attribute, the GPU cannot consume it directly. ANGLE falls back to CPU conversion via VertexArrayVk::convertVertexBufferCPU. To do this, it internally maps the entire buffer for reading (srcBuffer->mapForReadAccessOnly).
  4. The Free: If the attacker initially mapped only a small portion of the buffer, this new internal request to map the entire buffer forces BufferVk::allocStagingBuffer to reallocate the staging buffer. It calls mStagingBuffer.release(contextVk), freeing the original small staging buffer back to the VMA pool.
  5. The Use (Write): The passthrough decoder is unaware of ANGLE's internal reallocation, leaving its cached map_ptr dangling. When the attacker subsequently issues an UnmapBuffer command, GLES2DecoderPassthroughImpl::DoUnmapBuffer performs a memcpy from attacker-controlled shared memory directly into the dangling map_ptr.

Potential Steps to Trigger

Note: These are suggested theoretical steps as we do not yet have a working proof of concept.

  1. A compromised renderer process establishes a WebGL 2 context.
  2. The attacker creates a buffer (glBufferData with GL_STATIC_DRAW to ensure device-local memory).
  3. The attacker issues MapBufferRange to map a very small portion of the buffer (e.g., 4 bytes) for writing. The decoder caches the staging buffer pointer (map_ptr).
  4. The attacker sets up a vertex attribute (glVertexAttribPointer) bound to the mapped buffer, using an unaligned stride (e.g., 9) to force the CPU conversion fallback.
  5. The attacker issues a DrawArrays command. The validation bypass allows this. ANGLE's internal CPU conversion forces a full-buffer map, releasing the 4-byte staging buffer. The decoder's map_ptr is now a dangling pointer into the VMA free pool.
  6. The attacker issues standard WebGL commands (like uploading textures) to groom the VMA heap, reallocating the freed 4-byte slot with a sensitive Vulkan object.
  7. The attacker places a malicious payload in shared memory and calls UnmapBuffer. The decoder executes memcpy into the dangling map_ptr, overwriting the target object and potentially hijacking control flow in the GPU process.

Suggested Fix

The primary issue is the validation gap. To fix this:

  1. Update ValidateDrawStates in third_party/angle/src/libANGLE/validationES.cpp so it does not unconditionally skip the mapped buffer check for WebGL contexts. It should still enforce vertexArray->hasInvalidMappedArrayBuffer() if a buffer is genuinely mapped.
  2. Alternatively, completely block MapBufferRange and UnmapBuffer for all WebGL contexts, as these endpoints are explicitly removed in the WebGL 2.0 specification. This can be enforced in GLES2DecoderPassthroughImpl or ANGLE's ValidateMapBufferRangeBase.

Evaluated with Chrome root at commit: 137d451a126685dd5010e6609db9f6d4a78d8234


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 validation check that should prevent drawing from a mapped buffer is skipped for WebGL contexts, and an internal reallocation frees the staging buffer without updating the decoder's cached pointer.

Impact

A compromised renderer could write arbitrary data into freed memory managed by the Vulkan Memory Allocator, potentially leading to a sandbox escape.

What the attacker needed

Compromised renderer process; WebGL 2 context; ANGLE-Vulkan backend; passthrough command decoder

The fix

The validation gap should be fixed by enforcing the mapped buffer check for WebGL contexts or by blocking MapBufferRange and UnmapBuffer for all WebGL contexts.

How it was found

  1. A compromised renderer process establishes a WebGL 2 context.
  2. The attacker creates a buffer with glBufferData using GL_STATIC_DRAW.
  3. The attacker issues MapBufferRange to map a very small portion of the buffer for writing, and the decoder caches the staging buffer pointer.
  4. The attacker sets up a vertex attribute bound to the mapped buffer with an unaligned stride to force CPU conversion.
  5. The attacker issues a DrawArrays command; the validation bypass allows it, and ANGLE's internal CPU conversion forces a full-buffer map, releasing the small staging buffer and leaving the decoder's pointer dangling.
  6. The attacker issues standard WebGL commands to groom the VMA heap, then places a malicious payload in shared memory and calls UnmapBuffer, causing a memcpy into the dangling pointer.

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. A program can ask to 'map' a buffer (get a pointer to its memory) and then, while still holding that pointer, trigger an internal reallocation that frees the memory. Later, when the program writes through the old pointer, it writes into freed memory that may now hold something else, potentially letting an attacker take control.

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.