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

Integer overflow in ANGLE (CVE-2026-4452)

An integer overflow in ANGLE's D3D11 line-loop index handling lets a WebGL2 page request a huge draw that truncates the computed buffer size to zero while the copy still uses the full size. An attacker could trigger a heap buffer overflow write of roughly 4GB in the GPU process from any webpage.

cinzinga Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 21 days

Report description

ANGLE D3D11 drawLineLoop Integer Overflow 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://chromium.googlesource.com/angle/angle/+/refs/heads/main/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp


The problem

Please describe the technical details of the vulnerability

Renderer11::drawLineLoop has an integer overflow when computing the size of a mapped index buffer. The overflow check at line 2073 only validates the non-primitive-restart case (count+1 elements). When primitive restart is enabled, GetLineLoopIndices calls GetLineLoopWithRestartIndexCount which can return a significantly larger count due to index expansion at each restart boundary. The expanded output count multiplied by sizeof(GLuint) overflows unsigned int at line 2086-2087, truncating spaceNeeded to zero. The subsequent memcpy at line 2096 uses the full untruncated size, writing approximately 4GB of attacker-influenced data into a 16KB streaming index buffer.

Affected Code

Renderer11.cpp, drawLineLoop():

C++
// Line 2073-2078: overflow check only validates (count+1), not primitive restart expansion
bool indexCheck = static_cast<unsigned int>(count) + 1 >
                  (std::numeric_limits<unsigned int>::max() / sizeof(unsigned int));

// Line 2080-2081: GetLineLoopIndices expands indices beyond what the check allows
GetLineLoopIndices(indices, type, static_cast<GLuint>(count),
                   glState.isPrimitiveRestartEnabled(), &mScratchIndexDataBuffer);

// Line 2086-2087: unsigned int truncation (e.g. 1073741824 * 4 = 0x100000000 -> 0)
unsigned int spaceNeeded =
    static_cast<unsigned int>(sizeof(GLuint) * mScratchIndexDataBuffer.size());

// Line 2096-2097: memcpy uses full untruncated size, not spaceNeeded
memcpy(mappedMemory, &mScratchIndexDataBuffer[0],
       sizeof(GLuint) * mScratchIndexDataBuffer.size());

Steps to Reproduce

  1. Open Chrome on Windows (D3D11 is the default ANGLE backend, no flags needed)
  2. Navigate to the attached poc_lineloop_d3d11.html
  3. The page auto-fires: creates a WebGL2 context, allocates an element array buffer with 805306368 UNSIGNED_BYTE indices in the pattern [0, 1, 0xFF] repeating (0xFF = primitive restart), then calls gl.drawElements(gl.LINE_LOOP, 805306368, gl.UNSIGNED_BYTE, 0)
  4. GPU process crashes with access violation (WRITE of 4GB)

Note: the PoC allocates ~805MB for the element array buffer. Systems with less than ~2GB of available GPU process memory may fail the allocation before reaching the overflow.

Tested on:

  • Chrome 145.0.7632.110 (stable, Windows 11) -- GPU process crash
  • Chromium 146.0.7678.0 ASan (Windows 11, --in-process-gpu) -- heap-buffer-overflow WRITE of size 4294967296 at Renderer11.cpp:2096

With --in-process-gpu, the crash occurs in the browser process address space.

ASan Output

==21376==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x12722fe50000 at pc 0x7ffcdf71b4fc bp 0x00ed077fdb70 sp 0x00ed077fdbb8
WRITE of size 4294967296 at 0x12722fe50000 thread T23
    #0 0x7ffcdf71b4fb  (clang_rt.asan_dynamic-x86_64.dll+0x18004b4fb)
    #1 0x7ffcdb3fe543 in rx::Renderer11::drawLineLoop Renderer11.cpp:2096:5
    #2 0x7ffcdb401b6d in rx::Renderer11::drawElements Renderer11.cpp:1970:16
    #3 0x7ffcdb3b0a49 in rx::Context11::drawElements Context11.cpp:361:12
    #4 0x7ffcdabbacfb in GL_DrawElements entry_points_gles_2_0_autogen.cpp:1862:22
    #5 0x7ffc7d294f7b in gl::RealGLApi::glDrawElementsFn gl_gl_api_implementation.cc:401:16
    #6 0x7ffc7dae946b in gpu::gles2::GLES2DecoderPassthroughImpl::DoDrawElements gles2_cmd_decoder_passthrough_doers.cc:1163:10
    #7 0x7ffc7db338ea in gpu::gles2::GLES2DecoderPassthroughImpl::HandleDrawElements gles2_cmd_decoder_passthrough_handlers.cc:138:10
    #8 0x7ffc7db51cbc in gpu::gles2::GLES2DecoderPassthroughImpl::DoCommandsImpl gles2_cmd_decoder_passthrough.cc:742:20
    #9 0x7ffc67ce5e7b in gpu::CommandBufferService::Flush command_buffer_service.cc:267:35
    #10 0x7ffc7dcfd071 in gpu::CommandBufferStub::OnAsyncFlush command_buffer_stub.cc:504:22

0x12722fe50000 is located 6144 bytes before 359576-byte region [0x12722fe51800,0x12722fea9498)

SUMMARY: AddressSanitizer: heap-buffer-overflow Renderer11.cpp:2096:5 in rx::Renderer11::drawLineLoop

Full unabridged ASan output is attached as asan_output.txt.

Fix

Replace the unsigned int spaceNeeded with size_t, or validate mScratchIndexDataBuffer.size() after GetLineLoopIndices returns (accounting for primitive restart expansion) rather than only validating count+1 before the call:

C++
size_t spaceNeeded = sizeof(GLuint) * mScratchIndexDataBuffer.size();
ANGLE_CHECK(GetImplAs<Context11>(context),
            spaceNeeded <= std::numeric_limits<unsigned int>::max(),
            "Line loop index buffer too large", GL_OUT_OF_MEMORY);

The same fix should be applied to drawTriangleFan (line 2168).

Bisect

The vulnerable code was introduced in ANGLE commit 0d3537c224c7df5b90a2cf77678eb0987b6b7a30 ("D3D11: Implement ES3 primitive restart with line loops", 2015-11-06). This commit introduced unsigned int spaceNeeded = static_cast<unsigned int>(sizeof(GLuint) * mScratchIndexDataBuffer.size()) (truncation), and added a memcpy using the full untruncated sizeof(GLuint) * mScratchIndexDataBuffer.size() — but did not update the pre-existing overflow check to account for the expanded index count.

Impact analysis

Heap buffer overflow in the GPU process, reachable from JavaScript via WebGL2 on any webpage. No flags or special configuration required. D3D11 is the default ANGLE backend on all Windows Chrome installations. The overflow writes approximately 4GB of partially attacker-controlled data (vertex index values from the element array buffer) into a 16KB D3D11 streaming index buffer. With --in-process-gpu the corruption occurs in the browser process address space.


The cause

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

145.0.7632.110 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

The overflow check only accounts for count+1 indices, but primitive restart expansion makes the scratch buffer much larger, and the size is stored in an unsigned int that truncates to zero while memcpy uses the full size.

Impact

A heap buffer overflow in the sandboxed GPU process is reachable from JavaScript on any webpage with no flags, and with --in-process-gpu the corruption occurs in the browser process address space.

What the attacker needed

Windows with default D3D11 backend; victim visits a malicious page; ~2GB free GPU process memory

The fix

The size should be stored as size_t and the expanded scratch buffer size validated after GetLineLoopIndices returns, with the same fix applied to drawTriangleFan.

How it was found

  1. Open Chrome on Windows, where D3D11 is the default ANGLE backend.
  2. Load the proof-of-concept page that creates a WebGL2 context.
  3. The page allocates an element array buffer with many UNSIGNED_BYTE indices using 0xFF as the primitive restart marker.
  4. The page calls drawElements with LINE_LOOP and the large index count.
  5. The GPU process crashes with an access violation from the oversized write.

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.

WebGL lets a web page draw shapes using the graphics card. When the page asks for a line loop with a special 'restart' marker, the browser expands the list of points, and a size calculation wraps around to zero because it uses a small number type. The code then copies far more data than the small buffer can hold, corrupting memory in the graphics process.

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.