Out of bounds read in ANGLE (CVE-2026-9953)
Two buffer management flaws in ANGLE's Vulkan backend could cause an out-of-bounds read when drawing instanced line loops with a large vertex attribute divisor, and an out-of-bounds write when a cached conversion buffer is reused after the source buffer grows. An attacker could potentially leak GPU memory or overwrite adjacent Vulkan objects, possibly leading to a sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 40 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 https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: ANGLE's Vulkan backend contains two buffer management logic flaws. First, setupLineLoopDraw hardcodes an instance count of 1 during vertex stream allocation, potentially leading to an out-of-bounds read. Second, convertBufferToRGBA fails to resize cached conversion buffers when the source buffer grows, potentially leading to an out-of-bounds write via a compute shader.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp
Estimated timestamp from git blame: 2024-08-30
Overview
There are two distinct potential vulnerabilities in ANGLE's Vulkan backend related to buffer size calculations and allocations during emulation paths.
Issue 1: Potential Out-of-bounds Read in setupLineLoopDraw
In third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp, ContextVk::setupLineLoopDraw is responsible for setting up the state for LINE_LOOP primitives. When setting up the vertex attributes, it calls setupDraw with a hardcoded instanceCount of 1:
return setupDraw(context, mode, firstVertex, vertexOrIndexCount, 1, indexTypeOrInvalid, indices,
mIndexedDirtyBitsMask);
If the draw call is an instanced draw (e.g., drawArraysInstanced), and one of the vertex attributes requires software emulation (for instance, because its divisor exceeds the maximum supported hardware divisor, typically 255), VertexArrayVk::updateStreamedAttribs will allocate a streaming vertex buffer. Because instanceCount is passed as 1, it will allocate a buffer sized for only a single instance.
The subsequent Vulkan draw call will be dispatched with the full, attacker-controlled instance count. The vertex shader will fetch data for all instances, reading past the end of the undersized streaming buffer. Because the streaming buffer is sub-allocated from a larger dynamic buffer pool, this may not cause an immediate hard crash but can leak uninitialized GPU memory or data belonging to other contexts.
Potential Steps to Trigger (WebGL):
- Create a WebGL context and enable instancing.
- Create a vertex attribute and set its divisor to 256 (exceeding
mMaxVertexAttribDivisor). - Issue a
gl.drawArraysInstanced(gl.LINE_LOOP, 0, count, 1000)call.
Issue 2: Potential Out-of-bounds Write in convertBufferToRGBA
In third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp, TextureVk::convertBufferToRGBA handles the conversion of RGB buffer data to RGBA for TEXTURE_BUFFER targets. The conversion results are cached in ConversionBuffer objects attached to the BufferVk.
The cache key used to retrieve an existing ConversionBuffer (VertexConversionBuffer::CacheKey) includes the format and offset, but does not include the buffer size.
If an attacker creates a texture buffer with a small size, a small ConversionBuffer is allocated. If the attacker subsequently resizes the underlying buffer using glBufferData to a much larger size, the existing ConversionBuffer is merely marked dirty but is not freed or resized. When convertBufferToRGBA is called again, it reuses the small destination buffer but dispatches a compute shader (UtilsVk::copyRgbToRgba) to process the new, larger pixel count.
The compute shader will write the converted RGBA values past the end of the undersized destination buffer. In native GLES contexts (e.g., Android apps on Chrome OS ARCVM), robust buffer access is often disabled for performance, meaning the GPU hardware will not clamp the out-of-bounds writes. This could allow an attacker to overwrite adjacent Vulkan objects in GPU memory, potentially leading to a sandbox escape.
Potential Steps to Trigger (Native GLES):
- Create a buffer with a small size (e.g., 48 bytes) and attach it to a texture buffer with an RGB format.
- Issue a draw/compute call that samples the texture, triggering the allocation of a 64-byte conversion buffer.
- Call
glBufferDatato resize the source buffer to a large size (e.g., 10 MB). - Issue another draw/compute call sampling the texture buffer. The compute shader will write 10 MB of RGBA data into the 64-byte destination buffer.
Suggested Fixes
- For Issue 1: In
ContextVk::setupLineLoopDraw(and similar functions if applicable), pass the actualinstanceCountfrom the parent draw call tosetupDrawinstead of hardcoding1. - For Issue 2: In
TextureVk::convertBufferToRGBA, before reusing an existingConversionBuffer, ensure thatbufferHelper->getSize()is greater than or equal to the requiredconversionBufferSize. Alternatively, include the required size or a buffer generation ID in theCacheKeyso that a new buffer is allocated when the size increases.
Evaluated with Chrome root at commit: 2b349e31cb87959d6a548625986c65e0a2d2e380
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.
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 code hardcodes an instance count of 1 during vertex stream allocation and omits the buffer size from a conversion buffer cache key, so buffers are undersized for later operations.
Impact
The out-of-bounds read could leak uninitialised GPU memory or data from other contexts, and the out-of-bounds write could overwrite adjacent Vulkan objects, potentially leading to a sandbox escape, though robust buffer access may limit the write in some contexts.
What the attacker needed
WebGL context with instancing enabled; Native GLES context with robust buffer access disabled
The fix
The report suggests passing the actual instance count to setupDraw and ensuring the conversion buffer is resized or the cache key includes the required size.
How it was found
- Create a WebGL context and enable instancing.
- Create a vertex attribute and set its divisor to 256, exceeding the maximum supported divisor.
- Issue a gl.drawArraysInstanced call with LINE_LOOP mode and a large instance count.
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 two bugs in a graphics driver component called ANGLE, which translates WebGL and OpenGL ES commands for the Vulkan graphics API. In the first bug, a function that sets up line-loop drawing assumes only one instance will be drawn, so it allocates a buffer that is too small; when many instances are drawn, the graphics card reads past the end of that buffer. In the second bug, a cached buffer used for converting colour formats is not resized when the original buffer gets bigger, so a compute shader writes more data than the cache can hold, potentially corrupting other…
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.