Buffer overflow in ANGLE (CVE-2026-76046)
A format generation bug in ANGLE miscalculates the pixel size of a 10-bit packed format as 6 bytes instead of 8, so when a compromised Android renderer forces a CPU-readback copy of an imported hardware buffer, the staging buffer is 33% too small and the Vulkan driver writes out of bounds in the unsandboxed GPU process. An attacker with a compromised renderer could achieve a heap out-of-bounds write in the GPU process, potentially escaping the sandbox.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 31 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A format generation bug in ANGLE miscalculates the pixel size of R10X6G10X6B10X6A10X6_UNORM as 6 bytes instead of 8. When a compromised Android renderer forces a CPU-readback copy of an imported hardware buffer, ANGLE allocates a 33% undersized staging buffer. The Vulkan driver then writes 8 bytes per texel, causing an out-of-bounds write in the unsandboxed GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/Format_table_autogen.cppthird_party/angle/src/libANGLE/renderer/angle_format.pythird_party/angle/src/libANGLE/renderer/gen_angle_format_table.pythird_party/angle/src/libANGLE/formatutils.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cpp
Estimated timestamp from git blame: 2025-04-23
1. Summary of the Issue (Meant for Human Triage)
A potential critical table-data generation error exists in ANGLE's autogenerated format tables for the R10X6G10X6B10X6A10X6_UNORM format (which maps to Vulkan's VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16).
The true physical layout of this format utilizes 16-bit channels with 10 bits of color data and 6 bits of padding per channel, meaning 4 channels × 2 bytes/channel = 8 bytes per texel. However, due to a parser bug in angle_format.py, multiple X6 padding tokens collapse into a single dictionary entry. This causes the generator to compute a pixelBytes value of 6 instead of 8 in Format_table_autogen.cpp.
A compromised renderer can exploit this by importing an AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM Android Hardware Buffer (AHB) and intentionally misreporting its format as kRGBA_8888. When the renderer subsequently triggers a CopySubTextureCHROMIUM command, ANGLE's Vulkan backend falls back to a CPU-readback path. The staging buffer allocation is calculated using the incorrect pixelBytes = 6 value. The Vulkan driver then executes vkCmdCopyImageToBuffer using the hardware's physical texel block size of 8 bytes.
This mismatch results in a 33% out-of-bounds (OOB) write of GPU-writable memory (up to 2 * width * height bytes) into adjacent suballocations of ANGLE's shared host-mapped staging BufferPool. Because the GPU process is unsandboxed on Android, this heap OOB write represents a potential sandbox escape vulnerability.
2. Proof-of-Concept & Detailed Execution Flow
Note: These are suggested/potential steps to trigger the vulnerability, as our tooling agent doesn't yet have the ability to run code. They trace the precise, confirmed logic paths in the current codebase.
The Vulnerability Trigger Path (A-RENDERER to GPU-Host-OOB Write)
- AHB Allocation: The attacker, acting as a compromised renderer process on an Android device (API 34+), allocates an Android Hardware Buffer (
AHardwareBuffer) usingAHardwareBuffer_allocate. They configure theAHardwareBuffer_Descwith formatAHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM(0x3b), a target width and height (e.g., 1024x1024), and usage flags includingAHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFERandAHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY. Crucially, they omit theAHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGEflag. - Attacker Payload: The attacker locks the
AHardwareBuffermemory and writes attacker-controlled payload data into the pixel buffer. - IPC Forgery & Lack of Validation: The attacker wraps the
AHardwareBufferin agfx::GpuMemoryBufferHandleand invokesgpu.mojom::SharedImageInterface::CreateSharedImageover IPC. They deliberately misreport theSharedImageFormatasviz::SinglePlaneFormat::kRGBA_8888.- In the GPU process,
AHardwareBufferImageBackingFactory::CreateSharedImage(gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc:1102-1131) receives the request. It performs basic parameter validation but does not query the underlyingAHardwareBuffer_Desc.formatto cross-check against the attacker-suppliedsi_info.format. The backing is created successfully.
- In the GPU process,
- Texture Storage Import: The attacker sends
gles2::cmds::CreateAndTexStorage2DSharedImageINTERNAL, supplying theSharedImagemailbox. This triggers ANGLE to import theAHardwareBuffer.- In
HardwareBufferImageSiblingVkAndroid::initImpl(third_party/angle/src/libANGLE/renderer/vulkan/android/HardwareBufferImageSiblingVkAndroid.cpp:314),vkGetAndroidHardwareBufferPropertiesANDROIDretrieves the native Vulkan properties, populatingbufferFormatProperties.formatwithVK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16. CheckFormatSupportconfirms the format is natively supported by the driver, settingisExternalto false.- The
!isExternalcode path (HardwareBufferImageSiblingVkAndroid.cpp:385-388) resolves the actual ANGLE format viavk::GetFormatIDFromVkFormat, which maps directly toangle::FormatID::R10X6G10X6B10X6A10X6_UNORM(third_party/angle/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp:3502-3503). AhbDescUsageToVkImageUsageis called (HardwareBufferImageSiblingVkAndroid.cpp:78-107). BecauseAHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGEwas omitted,VK_IMAGE_USAGE_SAMPLED_BITis omitted from the image usage. (On non-Samsung devices,forceSampleUsageForAhbBackedImagesis disabled, ensuring this bit remains unset).
- In
- Forcing CPU Fallback: The attacker creates a standard
RGBA8destination texture and issuesgles2::cmds::CopySubTextureCHROMIUMto copy from the imported AHB to theRGBA8texture.- The command reaches
TextureVk::copySubTextureImpl(third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp:1726). CanCopyWithTransferForCopyTexturefails because the formats differ.CanCopyWithDrawfails because it checks(srcUsage & VK_IMAGE_USAGE_SAMPLED_BIT) != 0(TextureVk.cpp:177-188).- ANGLE falls back to the CPU readback path:
copyImageDataToBufferAndGetData->ImageHelper::copyImageDataToBuffer(third_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cpp:10989).
- The command reaches
- The Overrun Sink (
ImageHelper::copyImageDataToBuffer):- ANGLE retrieves the
angle::Formatstructure. Due to a generator bug inangle_format.py(lines 135-137), multipleX6padding tokens collapse into a single dictionary entrybits['X'] = 6. This causes the autogenerated tableFormat_table_autogen.cpp:170to incorrectly definepixelBytesas 6 instead of the actual physical block size of 8. - The staging buffer size is computed using the incorrect
pixelBytes:bufferSize = width * height * depth * 6 * layerCount(vk_helpers.cpp:11007-11009). For a 1024x1024 texture,bufferSizeis exactly 6,291,456 bytes. contextVk->initBufferForImageCopyallocatesroundUp(6291456 + 12, 12)bytes fromgetDefaultBufferPool(). This pool returns a suballocation out of a massive host-mappedVkBuffershared with other concurrent GPU-to-CPU operations (ContextVk.cpp:7013-7035).copyImageDataToBufferconfigures aVkBufferImageCopystructure withregions.bufferRowLength = 0(tightly packed), and invokescommandBuffer->copyImageToBuffer.- The Vulkan driver executes the tightly packed copy. Because the hardware format natively demands 8 bytes per texel block, the driver copies
1024 * 1024 * 8 = 8,388,608bytes of attacker-controlled pixel data. - Since the allocated suballocation is only ~6.29 MB, the driver writes over 2 megabytes out-of-bounds into adjacent suballocations in the shared
BufferPool, providing a deterministic GPU-Host-OOB write primitive.
- ANGLE retrieves the
Proposed Fix
- Format Generator (
angle_format.py): Modifyget_bitsto handle multiple padding tokens without collapsing them into a single dictionary key (e.g., track bits in a list or uniquely identify each padding token likeX0,X1). - AHB Format Cross-validation: Update
AHardwareBufferImageBackingFactory::CreateSharedImageto callAHardwareBuffer_describe()on the imported buffer and reject it if the underlying hardware format is incompatible with the requestedviz::SharedImageFormat. - Audit GL Internal Format: Ensure
gl::InternalFormat::pixelBytesresolves correctly forGL_R10X6G10X6B10X6A10X6_UNORM_ANGLEXinformatutils.cpp.
3. Technical Verification Details (Automated Audit Logs)
Severity: High (S1)
Brief Notes / Reasoning: The vulnerability is a valid and highly exploitable GPU-HOST-OOB write in the ANGLE Vulkan backend, leading to memory corruption in the GPU process. The root cause is a parsing bug in
angle_format.pywhere multipleX6tokens collapse into a single dictionary entry (bits['X'] = 6), incorrectly calculatingpixelBytes = 6instead of8forR10X6G10X6B10X6A10X6_UNORM.A compromised renderer (A-RENDERER) on Android can allocate an
AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORMAHB, import it viaSharedImageInterfaceclaiming it'skRGBA_8888(sinceAHardwareBufferImageBackingFactorylacks format cross-validation), and invokeCopySubTextureCHROMIUM. Because the formats mismatch and the AHB lacksSAMPLED_BIT, ANGLE falls back to the CPU copy path (copyImageDataToBufferAndGetData).During CPU fallback,
ImageHelper::copyImageDataToBufferallocates a host-mapped staging buffer suballocation in the sharedBufferPoolbased on the incorrectpixelBytes = 6(size ≈W * H * 6). However, the Vulkan driver'svkCmdCopyImageToBufferexecutes the copy using the physical format's true texel block size of 8 bytes. This results in a 33% (W * H * 2bytes) out-of-bounds write of attacker-controlled pixel data into adjacent suballocations of the staging pool.Since the GPU process is unsandboxed on Android, this memory corruption serves as a sandbox escape. MiraclePtr does not mitigate this, as the corruption occurs in host-mapped
VkDeviceMemorymanaged by ANGLE'sBufferPool, not PartitionAlloc. Following the guidelines for memory corruption in an unsandboxed process (GPU on Android) reachable from a compromised renderer, this warrants a High (S1) severity.
Exhaustive Evidence Ledger:
- Generator Bug Proof: Codebase Investigator confirmed
angle_format.pylines 135-137 executebits[token[0]] = int(token[1:]). ForR10X6G10X6B10X6A10X6, the regex yields['R10', 'X6', 'G10', 'X6', 'B10', 'X6', 'A10', 'X6']. The loop dictatesbits['X'] = 6, overwriting itself 4 times.gen_angle_format_table.pysumskChannelsto 46, creatingpixelBytes = ceil(46/8) = 6. This is explicitly emitted inFormat_table_autogen.cpp:170. - VkFormat Mapping: Confirmed via Codebase Investigator at
third_party/angle/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp:3502-3503:case VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:correctly maps toangle::FormatID::R10X6G10X6B10X6A10X6_UNORM. - AHB Import & Format Validation: Checked
HardwareBufferImageSiblingVkAndroid::initImpl. Investigator verified thatvkGetAndroidHardwareBufferPropertiesANDROIDchains and populatesbufferFormatProperties.format. If native formats are natively supported (formatHasNecessaryFormatSupport== true), the execution takes the!isExternalbranch (:385-388), completely bypassingNativePixelFormatToGLInternalFormat. This confirms how an undocumented AHB format reaches internal representation unaltered. - Absence of SharedImage Format Validation: Investigated
gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc:1102-1131. ConfirmedAHardwareBufferImageBackingFactory::CreateSharedImagedoes not invokeAHardwareBuffer_describeto cross-checkAHardwareBuffer_Desc.formatagainstsi_info.format. - Buffer Copy Alignment Logic: Evaluated
GetImageCopyBufferAlignmentinthird_party/angle/src/libANGLE/renderer/vulkan/vk_format_utils.cpp:375-404. WhenpixelBytesis 6, themultipliercalculates as6 % 2 != 0 ? 4 : 6 % 4 != 0 ? 2 : 1, resulting inmultiplier = 2. The returned alignment is2 * 6 = 12. This proves that the alignment padding logic is insufficient to accommodate the 33% (WH2 bytes) undersized calculation. - Environmental Prerequisites:
- Android API 34+ is required for
AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORMsupport (Hex0x3b). - Requires a non-Samsung Vulkan driver to ensure
forceSampleUsageForAhbBackedImagesis false (vk_renderer.cpp:6868), preventingCanCopyWithDrawfrom running.
- Android API 34+ is required for
Evaluated with Chrome root at commit: b96d2ec58f4f5f92b540a723966b199d6e9951b4
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 a parser bug in the format table generator collapses multiple padding tokens into one dictionary entry, so the computed pixel size is 6 instead of 8.
Impact
A compromised renderer could cause a heap out-of-bounds write in the unsandboxed GPU process, potentially escaping the sandbox; the text notes this is a suggested path and not yet executed.
What the attacker needed
Compromised Android renderer; Android API 34+; non-Samsung Vulkan driver
The fix
The format generator should handle multiple padding tokens without collapsing them, and the shared image factory should cross-check the hardware buffer's actual format against the requested format.
How it was found
- Allocate an Android Hardware Buffer with the 10-bit format and omit the GPU sampled image usage flag.
- Write attacker-controlled pixel data into the buffer.
- Import the buffer as a shared image while falsely reporting its format as RGBA8.
- Import the shared image into ANGLE as a texture.
- Issue a copy from the imported texture to an RGBA8 texture, forcing the CPU readback path.
- The staging buffer is sized with the wrong pixel size, so the driver writes out of bounds.
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 program that converts image formats made a mistake: it thought each pixel of a certain 10-bit format takes 6 bytes, but it actually takes 8. When a malicious app on an Android phone tricks the graphics system into copying such an image, the system reserves too little memory and then writes past the end of it. Because this happens in a privileged graphics process, it could let the attacker break out of the phone's app sandbox.
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.