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

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.cpp
  • third_party/angle/src/libANGLE/renderer/angle_format.py
  • third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py
  • third_party/angle/src/libANGLE/formatutils.cpp
  • third_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)

  1. AHB Allocation: The attacker, acting as a compromised renderer process on an Android device (API 34+), allocates an Android Hardware Buffer (AHardwareBuffer) using AHardwareBuffer_allocate. They configure the AHardwareBuffer_Desc with format AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM (0x3b), a target width and height (e.g., 1024x1024), and usage flags including AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER and AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY. Crucially, they omit the AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE flag.
  2. Attacker Payload: The attacker locks the AHardwareBuffer memory and writes attacker-controlled payload data into the pixel buffer.
  3. IPC Forgery & Lack of Validation: The attacker wraps the AHardwareBuffer in a gfx::GpuMemoryBufferHandle and invokes gpu.mojom::SharedImageInterface::CreateSharedImage over IPC. They deliberately misreport the SharedImageFormat as viz::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 underlying AHardwareBuffer_Desc.format to cross-check against the attacker-supplied si_info.format. The backing is created successfully.
  4. Texture Storage Import: The attacker sends gles2::cmds::CreateAndTexStorage2DSharedImageINTERNAL, supplying the SharedImage mailbox. This triggers ANGLE to import the AHardwareBuffer.
    • In HardwareBufferImageSiblingVkAndroid::initImpl (third_party/angle/src/libANGLE/renderer/vulkan/android/HardwareBufferImageSiblingVkAndroid.cpp:314), vkGetAndroidHardwareBufferPropertiesANDROID retrieves the native Vulkan properties, populating bufferFormatProperties.format with VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16.
    • CheckFormatSupport confirms the format is natively supported by the driver, setting isExternal to false.
    • The !isExternal code path (HardwareBufferImageSiblingVkAndroid.cpp:385-388) resolves the actual ANGLE format via vk::GetFormatIDFromVkFormat, which maps directly to angle::FormatID::R10X6G10X6B10X6A10X6_UNORM (third_party/angle/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp:3502-3503).
    • AhbDescUsageToVkImageUsage is called (HardwareBufferImageSiblingVkAndroid.cpp:78-107). Because AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE was omitted, VK_IMAGE_USAGE_SAMPLED_BIT is omitted from the image usage. (On non-Samsung devices, forceSampleUsageForAhbBackedImages is disabled, ensuring this bit remains unset).
  5. Forcing CPU Fallback: The attacker creates a standard RGBA8 destination texture and issues gles2::cmds::CopySubTextureCHROMIUM to copy from the imported AHB to the RGBA8 texture.
    • The command reaches TextureVk::copySubTextureImpl (third_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp:1726).
    • CanCopyWithTransferForCopyTexture fails because the formats differ.
    • CanCopyWithDraw fails 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).
  6. The Overrun Sink (ImageHelper::copyImageDataToBuffer):
    • ANGLE retrieves the angle::Format structure. Due to a generator bug in angle_format.py (lines 135-137), multiple X6 padding tokens collapse into a single dictionary entry bits['X'] = 6. This causes the autogenerated table Format_table_autogen.cpp:170 to incorrectly define pixelBytes as 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, bufferSize is exactly 6,291,456 bytes.
    • contextVk->initBufferForImageCopy allocates roundUp(6291456 + 12, 12) bytes from getDefaultBufferPool(). This pool returns a suballocation out of a massive host-mapped VkBuffer shared with other concurrent GPU-to-CPU operations (ContextVk.cpp:7013-7035).
    • copyImageDataToBuffer configures a VkBufferImageCopy structure with regions.bufferRowLength = 0 (tightly packed), and invokes commandBuffer->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,608 bytes 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.

Proposed Fix

  1. Format Generator (angle_format.py): Modify get_bits to 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 like X0, X1).
  2. AHB Format Cross-validation: Update AHardwareBufferImageBackingFactory::CreateSharedImage to call AHardwareBuffer_describe() on the imported buffer and reject it if the underlying hardware format is incompatible with the requested viz::SharedImageFormat.
  3. Audit GL Internal Format: Ensure gl::InternalFormat::pixelBytes resolves correctly for GL_R10X6G10X6B10X6A10X6_UNORM_ANGLEX in formatutils.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.py where multiple X6 tokens collapse into a single dictionary entry (bits['X'] = 6), incorrectly calculating pixelBytes = 6 instead of 8 for R10X6G10X6B10X6A10X6_UNORM.

    A compromised renderer (A-RENDERER) on Android can allocate an AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM AHB, import it via SharedImageInterface claiming it's kRGBA_8888 (since AHardwareBufferImageBackingFactory lacks format cross-validation), and invoke CopySubTextureCHROMIUM. Because the formats mismatch and the AHB lacks SAMPLED_BIT, ANGLE falls back to the CPU copy path (copyImageDataToBufferAndGetData).

    During CPU fallback, ImageHelper::copyImageDataToBuffer allocates a host-mapped staging buffer suballocation in the shared BufferPool based on the incorrect pixelBytes = 6 (size ≈ W * H * 6). However, the Vulkan driver's vkCmdCopyImageToBuffer executes the copy using the physical format's true texel block size of 8 bytes. This results in a 33% (W * H * 2 bytes) 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 VkDeviceMemory managed by ANGLE's BufferPool, 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.py lines 135-137 execute bits[token[0]] = int(token[1:]). For R10X6G10X6B10X6A10X6, the regex yields ['R10', 'X6', 'G10', 'X6', 'B10', 'X6', 'A10', 'X6']. The loop dictates bits['X'] = 6, overwriting itself 4 times. gen_angle_format_table.py sums kChannels to 46, creating pixelBytes = ceil(46/8) = 6. This is explicitly emitted in Format_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 to angle::FormatID::R10X6G10X6B10X6A10X6_UNORM.
  • AHB Import & Format Validation: Checked HardwareBufferImageSiblingVkAndroid::initImpl. Investigator verified that vkGetAndroidHardwareBufferPropertiesANDROID chains and populates bufferFormatProperties.format. If native formats are natively supported (formatHasNecessaryFormatSupport == true), the execution takes the !isExternal branch (:385-388), completely bypassing NativePixelFormatToGLInternalFormat. 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. Confirmed AHardwareBufferImageBackingFactory::CreateSharedImage does not invoke AHardwareBuffer_describe to cross-check AHardwareBuffer_Desc.format against si_info.format.
  • Buffer Copy Alignment Logic: Evaluated GetImageCopyBufferAlignment in third_party/angle/src/libANGLE/renderer/vulkan/vk_format_utils.cpp:375-404. When pixelBytes is 6, the multiplier calculates as 6 % 2 != 0 ? 4 : 6 % 4 != 0 ? 2 : 1, resulting in multiplier = 2. The returned alignment is 2 * 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_UNORM support (Hex 0x3b).
    • Requires a non-Samsung Vulkan driver to ensure forceSampleUsageForAhbBackedImages is false (vk_renderer.cpp:6868), preventing CanCopyWithDraw from running.

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.

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 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

  1. Allocate an Android Hardware Buffer with the 10-bit format and omit the GPU sampled image usage flag.
  2. Write attacker-controlled pixel data into the buffer.
  3. Import the buffer as a shared image while falsely reporting its format as RGBA8.
  4. Import the shared image into ANGLE as a texture.
  5. Issue a copy from the imported texture to an RGBA8 texture, forcing the CPU readback path.
  6. 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.

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.