Out of bounds write in ANGLE (CVE-2026-9900)
ANGLE's Vulkan backend always picked a renderable fallback image format when importing external memory, even when colour attachment usage was not requested. A compromised renderer could then get a wider format image bound to a smaller allocation and issue GL writes, causing an out-of-bounds write on the GPU heap.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 59 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: ANGLE's Vulkan backend unconditionally selects a renderable fallback format when importing external memory, even if color attachment usage is not requested. This can cause a larger format Vulkan image (e.g., 4bpp) to be bound to a smaller memory allocation (e.g., 2bpp). A compromised renderer can exploit this size mismatch by issuing GL writes, resulting in a potential out-of-bounds write on the GPU heap.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/MemoryObjectVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_format_utils.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp
Estimated timestamp from git blame: 2024-01-18
Description
A logic error in ANGLE's Vulkan backend leads to a potential Out-of-Bounds (OOB) write in the GPU process. When importing external memory to create a texture, ANGLE unconditionally selects a "renderable" fallback format, regardless of whether the requested usage includes COLOR_ATTACHMENT support.
The vulnerability exists in TextureVk::setStorageExternalMemory and MemoryObjectVk::createImage. In both functions, ANGLE calls vkFormat.getActualRenderableImageFormatID() to determine the internal format. If the Vulkan driver does not support a specific format (e.g., R4G4B4A4_UNORM, 2 bytes per pixel) as a color attachment, ANGLE falls back to a wider format (e.g., R8G8B8A8_UNORM, 4 bytes per pixel).
If the external memory was allocated by Chromium using the native 2bpp format (because it only required SAMPLED usage), ANGLE will subsequently create a 4bpp VkImage and bind it to that same 2bpp physical memory. An ASSERT(externalMemoryRequirements.size == mSize) exists in MemoryObjectVk::createImage to catch this, but it compiles out in release builds. The Passthrough Command Buffer does not prevent GL write commands on read-only SharedImages, allowing an attacker to trigger an OOB write.
Potential Attack Path
Note: These are suggested steps; our tooling agent does not currently have the ability to run code to verify a live PoC.
- A compromised renderer process sends a
CreateSharedImageIPC requesting thekRGBA_4444format with strictly read-oriented usages (e.g.,SHARED_IMAGE_USAGE_GLES2_READ), omitting write usages that force color attachment requirements. - Chromium's
ExternalVkImageBackingFactoryallocates a 2bppVkDeviceMemorybacking because the driver supports sampling fromR4G4B4A4_UNORM. - The renderer triggers GL access via
BeginSharedImageAccessDirectCHROMIUM(in read-only mode). - ANGLE imports the memory via
TextureVk::setStorageExternalMemory. It unconditionally callsgetActualRenderableImageFormatID(). - Lacking color attachment support for
RGBA_4444, ANGLE falls back to the 4bppRGBA8format and creates a 4bppVkImage. - In release builds, the
ASSERTchecking allocation sizes inMemoryObjectVk::createImageis bypassed, and the 4bppVkImageis bound to the 2bppVkDeviceMemory. - The renderer issues a GL write command like
glTexSubImage2D. The passthrough decoder does not block this despite the SharedImage read-only access mode. - The Vulkan driver executes the memory copy assuming a 4bpp destination, writing past the end of the 2bpp allocation, corrupting the Vulkan GPU heap and potentially leading to a sandbox escape.
Suggested Fix
- Respect Usage Flags: Update
TextureVk::setStorageExternalMemoryandMemoryObjectVk::createImageto evaluate the requestedusageFlags. IfVK_IMAGE_USAGE_COLOR_ATTACHMENT_BITis not requested, usevkFormat.getActualImageFormatID(vk::ImageFormatSupport::SampleOnly)instead of unconditionally requiring a renderable format. - Enforce Size Checks: Convert the
ASSERT(externalMemoryRequirements.size == mSize)inMemoryObjectVk::createImageto a hard macro (e.g.,ANGLE_VK_CHECKor returningangle::Result::Stop) so that size mismatches safely fail in release builds.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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 unconditionally requested a renderable image format instead of checking the requested usage flags, so a wider format was chosen than the memory was allocated for, and the size check was only an ASSERT that disappears in release builds.
Impact
The out-of-bounds write could corrupt the Vulkan GPU heap and potentially lead to a sandbox escape, but only from an already compromised renderer process.
What the attacker needed
Compromised renderer process; Vulkan driver lacking colour attachment for the small format
The fix
The code should respect the requested usage flags and use a sample-only format when colour attachment is not requested, and the size ASSERT should become a hard check that fails safely in release builds.
How it was found
- A compromised renderer asks for a shared image in a small 2bpp format with read-only usages.
- Chromium allocates 2bpp device memory because the driver can sample that format.
- The renderer begins read-only GL access to the shared image.
- ANGLE imports the memory and falls back to a 4bpp renderable format, creating a 4bpp image.
- The size ASSERT is compiled out in release builds, so the 4bpp image is bound to the 2bpp memory.
- The renderer issues a GL write command, and the driver writes past the end of the allocation.
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 texture in a graphics library can be stored in different pixel sizes, for example two bytes per pixel or four. Here the library asked the graphics driver for a four-byte-per-pixel image but attached it to memory that was only allocated for two bytes per pixel. Writing pixels through that image then spills past the end of the memory, which is a memory corruption bug.
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.