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

Heap buffer overflow in ANGLE (CVE-2026-5868)

ANGLE's Metal backend cached a texture format for out-of-range mip levels without reallocating native storage, so a later read sized its buffer for one byte per pixel while Metal wrote four. An attacker could trigger a GPU process heap overflow with attacker-controlled pixel data via WebGL2.

cinzinga Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 23 days

Report description

ANGLE Metal Stale mFormat Cache causes GPU OOB WRITE


Bug location

Where do you want to report your vulnerability?

Chrome VRP – Report security issues affecting the Chrome browser. See program rules

Which URL (or repository) have you found the vulnerability in?

https://source.chromium.org/chromium/chromium/src/+/main:third_party/angle/src/libANGLE/renderer/metal/TextureMtl.mm


The problem

Please describe the technical details of the vulnerability

Heap buffer overflow with attacker-controlled data in the GPU process via stale mFormat cache in ANGLE's Metal backend. Incomplete fix for chromium:435683799.

TextureMtl::redefineImage (TextureMtl.mm:2067) unconditionally sets mFormat for any texImage2D level, including out-of-range levels that do not trigger storage reallocation. Calling texImage2D at mip level 14 (TEXTURE_MAX_LEVEL=4) with format R8 poisons mFormat to R8 (1 byte/pixel) while the native Metal texture remains RGBA8 (4 bytes/pixel).

readPixelsImpl then sizes readPixelRowBuffer as Wx1 bytes. Metal's getBytes writes Wx4 bytes of actual RGBA8 data, overflowing 3xW bytes of attacker-controlled pixel data past the buffer.

Steps to Reproduce

Stable (Chrome 145.0.7632.160, macOS x86_64, Intel GPU, Metal backend):

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome file:///path/to/poc_write_crash.html

No flags required. Default configuration. The page auto-reloads and the GPU process crashes within 1-2 page loads.

chrome://crashes IDs:

  • 897c7d4318e7beb6
  • 63aee33eb14f4815

Terminal output from the crash:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber storageMode]: unrecognized selector sent to instance 0x4141414141414141'

The 0x4141414141414141 value is attacker-controlled pixel data from the overflow reaching ObjC dispatch. Full symbolized stack trace attached as crash_trace.txt.

Proposed Fix

Guard the mFormat cache update so it only applies to levels within native storage:

C++
    // Cache last defined image format:
-   mFormat                      = mtlFormat;
+   if (imageWithinNativeStorageLevels)
+   {
+       mFormat                  = mtlFormat;
+   }

The variable imageWithinNativeStorageLevels is already computed at line 2043 and gates the storage reallocation at line 2052. It should also gate the format cache update.

Bisect

The unconditional mFormat assignment was introduced in ANGLE commit fe26bae452 ("Metal backend implementation pt 2", 2019-10-10). Present since the Metal backend was first implemented, approximately Chrome 80.

The incomplete fix was commit 86a8d11c82 ("Metal: Fix potential incorrect format used for texSubImage", 2025-08-11), which patched setPerSliceSubImage and convertAndSetPerSliceSubImage but left line 2067 unfixed.

Impact analysis

  • Web-accessible via WebGL2 (no compromised renderer required).
  • GPU process heap overflow with attacker-controlled data (pixel values).
  • macOS only (Metal backend, Intel GPUs).
  • Seven affected code paths from the same stale mFormat root cause.

The cause

What version of Chrome have you found the security issue in?

145.0.7632.160 Stable

Is the security issue related to a crash?

Yes, it is related to a crash.

Choose the type of vulnerability

Memory Corruption (in a sandboxed process)

How would you like to be publicly acknowledged for your report?

cinzinga

The original report as published on the Chromium issue tracker, by cinzinga. 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 the format cache was updated unconditionally for texImage2D levels outside native storage, leaving the cached format inconsistent with the real Metal texture layout.

Impact

A web page could cause a heap overflow in the sandboxed GPU process with attacker-controlled pixel data, leading to a crash and potentially further exploitation; the report notes it is macOS only on the Metal backend.

What the attacker needed

MacOS with Metal backend; Victim loads a malicious page; No special flags needed

The fix

The format cache update should be gated by the existing check that the image is within native storage levels, as the report proposes.

How it was found

  1. Open the proof-of-concept page in Chrome on macOS with the Metal backend.
  2. Let the page auto-reload once or twice.
  3. Observe the GPU process crash.

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 is stored in memory with a certain number of bytes per pixel. The code remembered the wrong format for a texture level that was never actually resized, so when it copied the image out it reserved too little space and wrote past the end. Because the extra bytes come from pixel data the attacker supplies, they can control what gets overwritten.

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

View all

8 more disclosed reports, best first.

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.