Integer overflow in ANGLE (CVE-2026-17717)
A 32-bit integer overflow in ANGLE's Vulkan vertex format conversion can make the destination buffer far smaller than intended, and a crafted sub-data update then writes converted vertex data out of bounds. On 32-bit systems this could allow corruption of adjacent GPU memory and potentially code execution in the GPU process.
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 32-bit integer overflow exists in ANGLE's Vulkan backend during vertex buffer format conversion. By allocating a large WebGL buffer and carefully selecting an emulated vertex format, an attacker can cause the destination buffer size calculation to overflow, resulting in an undersized allocation. Subsequent sub-data updates can be used to precisely write converted vertex data out-of-bounds, potentially leading to arbitrary code execution in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/UtilsVk.cpp
Estimated timestamp from git blame: Unknown (Google3 checkout)
Summary
A potential renderer-to-GPU sandbox escape vulnerability exists in ANGLE's Vulkan backend due to a 32-bit integer overflow when allocating memory for vertex buffer format conversion. On 32-bit systems (e.g., Windows x86, Android ARMv7), the size calculation for the destination conversion buffer can overflow, leading to an undersized allocation. An attacker can carefully craft gl.bufferSubData calls to trigger an out-of-bounds write of arbitrary vertex data into the GPU memory pool.
Because the GPU process is unsandboxed on Android, this could lead directly to full device compromise.
Technical Details
When ANGLE emulates an unsupported vertex format, it performs the conversion using a compute shader. The size of the required destination buffer is calculated in CalculateMaxVertexCountForConversion within third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp:
// third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp:369
ANGLE_TRY(contextVk->initBufferForVertexConversion(conversion, maxNumVertices * dstStride,
hostVisible));
On 32-bit platforms, size_t is 32-bit. The expression maxNumVertices * dstStride is evaluated using 32-bit math. An attacker can create a large WebGL buffer (~1GB) with a format like R8G8B8A8_SSCALED (stride 1). This format falls back to R16G16B16A16_FLOAT (stride 8). By setting the buffer size to roughly 1GB, maxNumVertices is roughly 1 billion. Multiplying this by the dstStride of 8 causes the 32-bit math to overflow to a very small number (e.g., 8 bytes).
initBufferForVertexConversion then allocates a tiny buffer (typically rounded up to 256 bytes) based on this overflowed value.
If the attacker simply dispatched the full conversion, the math in UtilsVk::convertVertexBuffer (componentCount = params.vertexCount * shaderParams.Nd) would also overflow (e.g., $1,073,741,825 \times 4 = 4$ modulo $2^{32}$). This prevents a massive 4GB write and prevents crashing the GPU.
However, the attacker can leverage glBufferSubData to craft a precise out-of-bounds write.
Potential Steps to Reproduce
Note: These steps are based on static analysis; our tooling cannot run the code to produce a fully working PoC.
-
On a 32-bit system, the attacker creates a WebGL 2 buffer of exactly
1,073,741,828bytes (safely below Blink's 2GB array buffer limit). -
They configure
gl.vertexAttribPointerwith an emulated format (e.g., 4 components,BYTE, not normalized) which maps toR8G8B8A8_SSCALEDand converts toR16G16B16A16_FLOAT(dstStride = 8). -
The attacker issues a draw call.
CalculateMaxVertexCountForConversionoverflows ($1073741825 \times 8 = 8589934600 \equiv 8 \pmod{2^{32}}$). ANGLE allocates a 256-byte VMA buffer. BecausecomponentCountalso overflows, the compute shader harmlessly converts 1 vertex, avoiding a crash. -
The attacker calls
gl.bufferSubDatato update 4 bytes at an offset of536,871,040. -
The attacker draws again. ANGLE calculates the dirty range offset in
CalculateOffsetAndVertexCountForDirtyRange:C++ size_t vertexCountToSkip = (static_cast<size_t>(dirtyRange.low()) - srcOffset) / srcStride; // ... dstOffset += vertexCountToSkip * dstStride; -
This evaluates to
536871040 * 8 = 4294968320, which overflows a 32-bit integer to1024. -
params.dstOffsetis now1024. The compute shader converts the single updated vertex and writes it to offset1024inside the 256-byte VMA suballocation. -
This results in a precise 8-byte out-of-bounds write into adjacent GPU memory. Standard Vulkan
robustBufferAccessbounding is performed against the entireVkDeviceMemoryblock, not the specific suballocation, allowing the OOB write to succeed. By repeating this with different subdata offsets, the attacker can precisely corrupt descriptor sets, Uniform Buffers, or Command Buffers, leading to RCE in the GPU process.
Suggested Fix
Use base::CheckedNumeric or base::MakeCheckedNum or angle::CheckedNumeric to perform the size and offset calculations within CalculateMaxVertexCountForConversion and CalculateOffsetAndVertexCountForDirtyRange. If an overflow is detected, fail the buffer initialisation/conversion gracefully (e.g. by returning an GL_OUT_OF_MEMORY or failing the draw).
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.
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 size and offset calculations for the conversion buffer use unchecked 32-bit arithmetic, so large vertex counts and strides wrap around and produce an undersized allocation and a wrapped destination offset.
Impact
This could lead to arbitrary code execution in the GPU process, and because the GPU process is unsandboxed on Android it could lead directly to full device compromise; the write is limited to 8 bytes per attempt and only works on 32-bit systems.
What the attacker needed
32-bit platform (e.g. Windows x86, Android ARMv7); WebGL 2 support; ability to run attacker-controlled web content
The fix
The calculations should use checked arithmetic and fail the buffer initialisation or conversion gracefully when an overflow is detected.
How it was found
- Create a very large WebGL 2 buffer on a 32-bit system, just under the array buffer limit.
- Set a vertex attribute pointer to an emulated format that converts to a wider destination stride.
- Issue a draw call so the destination size calculation overflows and a tiny buffer is allocated.
- Call bufferSubData to update a few bytes at a large offset.
- Draw again so the dirty-range offset calculation overflows to a small value.
- The converted vertex is written past the end of the small allocation into adjacent GPU 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.
When a graphics card does not support a particular way of storing vertex data, the browser's graphics layer converts it into a supported format using a small program on the GPU. The amount of memory needed for the converted copy is worked out with ordinary 32-bit arithmetic, which can wrap around to a tiny number when the buffer is very large. The result is that the conversion writes past the end of the small buffer it was given, into memory it should not touch.
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.