Heap buffer overflow in ANGLE (CVE-2026-8525)
A heap buffer overflow occurs in ANGLE's GL backend when the shiftInstancedArrayDataWithOffset workaround increases the vertex count after the streaming buffer is allocated, causing a memcpy to write past the buffer end. An attacker could trigger this via WebGL drawArraysInstanced with first > 0, leading to a GPU process crash.
Originally disclosed on Chrome VRP
- Fix shipped in 44 days
Steps to reproduce the problem
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:print_stacktrace=1 \
out/asan/chrome \
--no-sandbox \
--headless=new \
--use-angle=gl \
--ozone-platform=headless \
--no-first-run \
--disable-background-networking \
--disable-sync \
--disable-extensions \
--ignore-gpu-blocklist \
--enable-angle-features=shiftInstancedArrayDataWithOffset \
--virtual-time-budget=20000 \
poc.html
Problem Description
Summary
VertexArrayGL::streamAttributes() in ANGLE's GL backend allocates a streaming vertex buffer based on ComputeVertexBindingElementCount(), then the shiftInstancedArrayDataWithOffset workaround increases streamedVertexCount after allocation. The slow-path memcpy loop writes past the buffer end. This is a heap-buffer-overflow in the GPU process, reachable from WebGL via drawArraysInstanced with first > 0.
- File:
third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp - Bug lines: 492-496 (count increased), 548-554 (writes with increased count)
- Process: GPU process
- Tested: Chromium 148.0.7762.0 (commit
371e35b061) - Platform: macOS Intel (non-Haswell) by default; reproducible on any platform with
--enable-angle-features=shiftInstancedArrayDataWithOffset
Root Cause
Line 415: computeStreamingAttributeSizes() computes streamingDataSize using the original vertex count from ComputeVertexBindingElementCount().
Line 438: Buffer allocated with original size: bufferData(GL_ARRAY_BUFFER, requiredBufferSize, ...).
Lines 495-496: Workaround increases the vertex count:
streamedVertexCount = (instanceCount + indexRange.start() + adjustedDivisor - 1u) / adjustedDivisor;
Lines 548-554: Slow-path copy loop uses the increased count:
for (size_t vertexIdx = 0; vertexIdx < streamedVertexCount; vertexIdx++) {
uint8_t *out = bufferPointer + curBufferOffset + (destStride * vertexIdx);
const uint8_t *in = inputPointer + sourceStride * (vertexIdx + firstIndexForSeparateCopy);
memcpy(out, in, destStride);
}
With first=100, instanceCount=1024, divisor=1: original count = 1024, new count = 1124. Buffer sized for 1024 vertices, loop writes 1124. Overflow = 100 * destStride bytes.
The slow path is taken when sourceStride != destStride (e.g., vertex attribute with stride=20 for vec4 which packs to 16).
Suggested Fix
In streamAttributes(), after the workaround modifies streamedVertexCount at line 495-496, recompute batchMemcpySize and ensure the buffer allocation at line 438 accounts for the maximum possible vertex count.
Summary
Heap-buffer-overflow in VertexArrayGL::streamAttributes via shiftInstancedArrayDataWithOffset
Custom Questions
Type of crash:
GPU process crash
Crash state:
==500925==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7186c57fd230 at pc 0x631b84c7600b bp 0x7ffc2b03d690 sp 0x7ffc2b03ce50
READ of size 16 at 0x7186c57fd230 thread T0 (chrome)
#0 0x631b84c7600a in __asan_memcpy (/home/calysteon/chromium/src/out/asan/chrome+0x196e900a) (BuildId: 330ba48cdf0bd5aa)
#1 0x6ee6ba61f271 in rx::VertexArrayGL::streamAttributes(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, gl::IndexRange const&, bool) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:553:21
#2 0x6ee6ba61beb5 in rx::VertexArrayGL::syncDrawState(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, int, gl::DrawElementsType, void const*, int, bool, void const**) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:264:27
#3 0x6ee6ba61b6de in rx::VertexArrayGL::syncClientSideData(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, int, int) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:180:12
#4 0x6ee6ba4e5453 in rx::ContextGL::drawArraysInstanced(gl::Context const*, gl::PrimitiveMode, int, int, int) third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp:266:26
#5 0x6ee6b9f7c6d8 in gl::Context::drawArraysInstanced(gl::PrimitiveMode, int, int, int) third_party/angle/src/libANGLE/Context.cpp:2961:26
#6 0x6ee6b9779072 in GL_DrawArraysInstanced third_party/angle/src/libGLESv2/entry_points_gles_3_0_autogen.cpp:1132:22
#7 0x631bad5b541d in gpu::gles2::GLES2DecoderImpl::HandleDrawArraysInstancedANGLE(unsigned int, void const volatile*) gpu/command_buffer/service/<gles2_cmd_decoder.cc:9429>:18
#8 0x631bad5fbd19 in gpu::error::Error gpu::gles2::GLES2DecoderImpl::DoCommandsImpl<false>(unsigned int, void const volatile*, int, int*) gpu/command_buffer/service/<gles2_cmd_decoder.cc:4766>:18
#9 0x631b93ed348d in gpu::CommandBufferService::Flush(int, gpu::AsyncAPIInterface*) gpu/command_buffer/service/<command_buffer_service.cc:267>:35
#10 0x631bad49be45 in gpu::CommandBufferStub::OnAsyncFlush(int, unsigned int, std::__Cr::vector<gpu::SyncToken, std::__Cr::allocator<gpu::SyncToken>> const&) gpu/ipc/service/<command_buffer_stub.cc:504>:22
#11 0x631bad49ae36 in gpu::CommandBufferStub::ExecuteDeferredRequest(gpu::mojom::DeferredCommandBufferRequestParams&, gpu::FenceSyncReleaseDelegate*) gpu/ipc/service/<command_buffer_stub.cc:173>:7
#12 0x631bad4c5a1b in gpu::GpuChannel::ExecuteDeferredRequest(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*) gpu/ipc/service/<gpu_channel.cc:833>:13
#13 0x631bad4d3f17 in void base::internal::DecayedFunctorTraits<void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>&&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&>::Invoke<void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel> const&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*>(void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel> const&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&, gpu::FenceSyncReleaseDelegate*&&) base/functional/bind_internal.h:740:12
#14 0x631bad4d3cf9 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::*&&)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>&&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&>, base::internal::BindState<true, true, false, void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>, mojo::StructPtr<gpu::mojom::DeferredRequestParams>>, void (gpu::FenceSyncReleaseDelegate*)>::RunOnce(base::internal::BindStateBase*, gpu::FenceSyncReleaseDelegate*) base/functional/bind_internal.h:956:5
#15 0x631b93f20bb8 in base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>::Run(gpu::FenceSyncReleaseDelegate*) && base/functional/callback.h:155:12
#16 0x631b93f2092a in void base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>&&, gpu::FenceSyncReleaseDelegate*>, base::internal::BindState<false, true, true, base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>, base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunImpl<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>, std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, 0ul>(base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>&&, std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>&&, std::__Cr::integer_sequence<unsigned long, 0ul>) base/functional/bind_internal.h:815:49
#17 0x631b85572945 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#18 0x631b93eee378 in gpu::Scheduler::ExecuteSequence(base::IdType<gpu::SyncPointOrderData, unsigned int, 0u, 1u>) gpu/command_buffer/service/<scheduler.cc:707>:29
#19 0x631b93eeba79 in gpu::Scheduler::RunNextTask() gpu/command_buffer/service/<scheduler.cc:625>:3
#20 0x631b93ef0af1 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::Scheduler::*&&)(), gpu::Scheduler*>, base::internal::BindState<true, true, false, void (gpu::Scheduler::*)(), base::internal::UnretainedWrapper<gpu::Scheduler, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:740:12
#21 0x631b85572945 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#22 0x631ba309a7d7 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/task/common/<task_annotator.cc:229>:34
#23 0x631ba314a045 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/common/task_annotator.h:112:5
#24 0x631ba31483ed in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/<thread_controller_with_message_pump_impl.cc:340>:40
#25 0x631ba2f19d33 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/<message_pump_default.cc:42>:55
#26 0x631ba314c442 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/<thread_controller_with_message_pump_impl.cc:644>:12
#27 0x631ba2ffc654 in base::RunLoop::Run(base::Location const&) base/<run_loop.cc:135>:14
#28 0x631bafca9c53 in content::GpuMain(content::MainFunctionParams) content/gpu/<gpu_main.cc:484>:14
#29 0x631b9e44968a in content::RunZygote(content::ContentMainDelegate*) content/app/<content_main_runner_impl.cc:664>:14
#30 0x631b9e44ad86 in content::RunOtherNamedProcessTypeMain(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*) content/app/<content_main_runner_impl.cc:771>:12
#31 0x631b9e44e0cc in content::ContentMainRunnerImpl::Run() content/app/<content_main_runner_impl.cc:1152>:10
#32 0x631b9e447241 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/<content_main.cc:358>:36
#33 0x631b9e44783c in content::ContentMain(content::ContentMainParams) content/app/<content_main.cc:371>:10
#34 0x631b84cb2b38 in ChromeMain chrome/app/<chrome_main.cc:191>:12
#35 0x72e6c722a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#36 0x72e6c722a28a in __libc_start_main csu/../csu/libc-start.c:360:3
SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/calysteon/chromium/src/out/asan/chrome+0x196e900a) (BuildId: 330ba48cdf0bd5aa) in __asan_memcpy
Reporter credit:
Nathaniel Oh (@calysteon)
Additional Data
Category: Security
Chrome Channel: Dev
Regression: N/A \
Heap buffer overflow in ANGLE: when a workaround outgrows its buffer
Context
ANGLE is the translation layer Chrome uses to run WebGL and OpenGL ES on top of the platform's native graphics API. On the GL backend, rx::VertexArrayGL is responsible for taking client-side vertex data supplied by the page and streaming it into a GPU buffer before a draw call. When the source and destination layouts differ, streamAttributes() falls back to a slow path that copies each vertex with memcpy into a buffer sized ahead of time.
One of ANGLE's workarounds, shiftInstancedArrayDataWithOffset, adjusts how instanced array data is laid out when a draw starts at a non-zero first index. The report shows that this workaround changes the vertex count after the streaming buffer has already been allocated, so the copy loop writes past the end of the heap allocation. The bug lives in the GPU process and is reachable from WebGL through drawArraysInstanced with first > 0.
The affected file is:
third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
The buggy lines are 492-496 (where the count is increased) and 548-554 (where the copy uses the increased count).
Setup
The researcher tested Chromium 148.0.7762.0 at commit 371e35b061, using an AddressSanitizer build of Chrome. The default reproduction platform is macOS Intel (non-Haswell), but the report states the bug is reproducible on any platform as long as the shiftInstancedArrayDataWithOffset feature is enabled.
No accounts, roles or special privileges are involved. The only precondition is a build with ASAN and the ability to launch Chrome with the flags below, plus a poc.html page that issues the WebGL draw.
Finding it
The report describes an ordering problem in the streaming path:
computeStreamingAttributeSizes()computesstreamingDataSizefrom the original vertex count returned byComputeVertexBindingElementCount().- The buffer is allocated with that original size via
bufferData(GL_ARRAY_BUFFER, requiredBufferSize, ...). - The
shiftInstancedArrayDataWithOffsetworkaround then increasesstreamedVertexCount. - The slow-path copy loop iterates over the increased count and writes past the end of the allocation.
The slow path is only taken when sourceStride != destStride, for example a vertex attribute declared with stride 20 for a vec4 that packs down to 16 bytes. That mismatch is what makes the copy loop run at all.
Exploitation
Step 1: launch Chrome with the workaround enabled
The researcher runs an ASAN build of Chrome headless with the ANGLE GL backend and the workaround feature explicitly enabled:
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:print_stacktrace=1 \
out/asan/chrome \
--no-sandbox \
--headless=new \
--use-angle=gl \
--ozone-platform=headless \
--no-first-run \
--disable-background-networking \
--disable-sync \
--disable-extensions \
--ignore-gpu-blocklist \
--enable-angle-features=shiftInstancedArrayDataWithOffset \
--virtual-time-budget=20000 \
poc.html
The important flags are --use-angle=gl (selects the GL backend where the bug lives), --enable-angle-features=shiftInstancedArrayDataWithOffset (turns on the workaround that triggers the count increase), and the ASAN options that halt on the first error and print a stack trace. --virtual-time-budget=20000 gives the page enough virtual time to run the draw.
Step 2: trigger the draw from WebGL
The draw reaches GL_DrawArraysInstanced in the GPU process, which dispatches through gl::Context::drawArraysInstanced, rx::ContextGL::drawArraysInstanced, rx::VertexArrayGL::syncClientSideData, rx::VertexArrayGL::syncDrawState, and finally rx::VertexArrayGL::streamAttributes. That call reaches GL_DrawArraysInstanced in the GPU process, which dispatches through gl::Context::drawArraysInstanced, rx::ContextGL::drawArraysInstanced, rx::VertexArrayGL::syncClientSideData, rx::VertexArrayGL::syncDrawState, and finally rx::VertexArrayGL::streamAttributes. The copy loop at line 553 runs with the inflated count and ASAN reports the overflow.
Step 3: observe the crash
The crash state reported by ASAN:
==500925==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7186c57fd230 at pc 0x631b84c7600b bp 0x7ffc2b03d690 sp 0x7ffc2b03ce50
READ of size 16 at 0x7186c57fd230 thread T0 (chrome)
#0 0x631b84c7600a in __asan_memcpy (/home/calysteon/chromium/src/out/asan/chrome+0x196e900a) (BuildId: 330ba48cdf0bd5aa)
#1 0x6ee6ba61f271 in rx::VertexArrayGL::streamAttributes(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, gl::IndexRange const&, bool) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:553:21
#2 0x6ee6ba61beb5 in rx::VertexArrayGL::syncDrawState(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, int, gl::DrawElementsType, void const*, int, bool, void const**) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:264:27
#3 0x6ee6ba61b6de in rx::VertexArrayGL::syncClientSideData(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, int, int) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:180:12
#4 0x6ee6ba4e5453 in rx::ContextGL::drawArraysInstanced(gl::Context const*, gl::PrimitiveMode, int, int, int) third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp:266:26
#5 0x6ee6b9f7c6d8 in gl::Context::drawArraysInstanced(gl::PrimitiveMode, int, int, int) third_party/angle/src/libANGLE/Context.cpp:2961:26
#6 0x6ee6b9779072 in GL_DrawArraysInstanced third_party/angle/src/libGLESv2/entry_points_gles_3_0_autogen.cpp:1132:22
#7 0x631bad5b541d in gpu::gles2::GLES2DecoderImpl::HandleDrawArraysInstancedANGLE(unsigned int, void const volatile*) gpu/command_buffer/service/<gles2_cmd_decoder.cc:9429>:18
#8 0x631bad5fbd19 in gpu::error::Error gpu::gles2::GLES2DecoderImpl::DoCommandsImpl<false>(unsigned int, void const volatile*, int, int*) gpu/command_buffer/service/<gles2_cmd_decoder.cc:4766>:18
#9 0x631b93ed348d in gpu::CommandBufferService::Flush(int, gpu::AsyncAPIInterface*) gpu/command_buffer/service/<command_buffer_service.cc:267>:35
#10 0x631bad49be45 in gpu::CommandBufferStub::OnAsyncFlush(int, unsigned int, std::__Cr::vector<gpu::SyncToken, std::__Cr::allocator<gpu::SyncToken>> const&) gpu/ipc/service/<command_buffer_stub.cc:504>:22
#11 0x631bad49ae36 in gpu::CommandBufferStub::ExecuteDeferredRequest(gpu::mojom::DeferredCommandBufferRequestParams&, gpu::FenceSyncReleaseDelegate*) gpu/ipc/service/<command_buffer_stub.cc:173>:7
#12 0x631bad4c5a1b in gpu::GpuChannel::ExecuteDeferredRequest(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*) gpu/ipc/service/<gpu_channel.cc:833>:13
#13 0x631bad4d3f17 in void base::internal::DecayedFunctorTraits<void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>&&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&>::Invoke<void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel> const&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*>(void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel> const&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*&&) base/functional/bind_internal.h:740:12
#14 0x631bad4d3cf9 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::*&&)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>&&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&>, base::internal::BindState<true, true, false, void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>, mojo::StructPtr<gpu::mojom::DeferredRequestParams>>, void (gpu::FenceSyncReleaseDelegate*)>::RunOnce(base::internal::BindStateBase*, gpu::FenceSyncReleaseDelegate*) base/functional/bind_internal.h:956:5
#15 0x631b93f20bb8 in base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>::Run(gpu::FenceSyncReleaseDelegate*) && base/functional/callback.h:155:12
#16 0x631b93f2092a in void base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>&&, gpu::FenceSyncReleaseDelegate*>, base::internal::BindState<false, true, true, base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>, base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunImpl<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>, std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, 0ul>(base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>&&, std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>&&, std::__Cr::integer_sequence<unsigned long, 0ul>) base/functional/bind_internal.h:815:49
#17 0x631b85572945 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#18 0x631b93eee378 in gpu::Scheduler::ExecuteSequence(base::IdType<gpu::SyncPointOrderData, unsigned int, 0u, 1u>) gpu/command_buffer/service/<scheduler.cc:707>:29
#19 0x631b93eeba79 in gpu::Scheduler::RunNextTask() gpu/command_buffer/service/<scheduler.cc:625>:3
#20 0x631b93ef0af1 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::Scheduler::*&&)(), gpu::Scheduler*>, base::internal::BindState<true, true, false, void (gpu::Scheduler::*)(), base::internal::UnretainedWrapper<gpu::Scheduler, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunOnce(base::inte
The top frame is __asan_memcpy, called from VertexArrayGL::streamAttributes at VertexArrayGL.cpp:553:21. The call chain confirms the path from the WebGL entry point (GL_DrawArraysInstanced) through the command buffer decoder into ANGLE and down to the copy loop. The crash is a GPU process crash.
Root cause
The allocation and the copy disagree about how many vertices to handle.
Line 415: computeStreamingAttributeSizes() computes streamingDataSize using the original vertex count from ComputeVertexBindingElementCount().
Line 438: the buffer is allocated with that original size:
bufferData(GL_ARRAY_BUFFER, requiredBufferSize, ...)
Lines 495-496: the workaround increases the vertex count:
streamedVertexCount = (instanceCount + indexRange.start() + adjustedDivisor - 1u) / adjustedDivisor;
Lines 548-554: the slow-path copy loop uses the increased count:
for (size_t vertexIdx = 0; vertexIdx < streamedVertexCount; vertexIdx++) {
uint8_t *out = bufferPointer + curBufferOffset + (destStride * vertexIdx);
const uint8_t *in = inputPointer + sourceStride * (vertexIdx + firstIndexForSeparateCopy);
memcpy(out, in, destStride);
}
With first=100, instanceCount=1024 and divisor=1, the original count is 1024 and the new count is 1124. The buffer is sized for 1024 vertices, but the loop writes 1124. The overflow is 100 * destStride bytes.
The slow path is taken when sourceStride != destStride, for example a vertex attribute with stride 20 for a vec4 that packs to 16. Without that mismatch the copy loop does not run and the overflow does not occur.
Impact
The report classifies this as a heap buffer overflow in the GPU process, reachable from WebGL via drawArraysInstanced with first > 0. The immediate effect is a GPU process crash. The report does not describe any further exploitation, such as controlled writes or sandbox escape, and does not state what an attacker could achieve beyond the crash. In the report's example the overflow is 100 * destStride bytes.
Fix
The suggested fix is in streamAttributes(): after the workaround modifies streamedVertexCount at lines 495-496, recompute batchMemcpySize and make sure the buffer allocation at line 438 accounts for the maximum possible vertex count. The report does not state whether a patch was applied or which change landed.
- Other workarounds that adjust counts after allocation. Look for any ANGLE feature flag that changes vertex or instance counts after
computeStreamingAttributeSizes()has run. A positive result is an ASAN heap-buffer-overflow instreamAttributeswith the flag enabled. - Different stride mismatches. Try attribute layouts where
sourceStride != destStride(for example avec4declared with stride 20 packing to 16). A positive result is the slow-path copy loop being reached and the overflow appearing at line 553. - Larger
firstvalues. Increasefirstwhile keepinginstanceCountanddivisorfixed. A positive result is a larger reported overflow size, consistent withfirst * destStride. - Other draw entry points. Test
drawElementsInstancedand related instanced draws with a non-zero starting index. A positive result is the same crash state reached through a different entry point in the stack. - Platforms other than macOS Intel. Run the same PoC on other platforms with
--enable-angle-features=shiftInstancedArrayDataWithOffset. A positive result is the same ASAN report, confirming the bug is not platform-specific.
What happened, in plain words
Chrome draws web pages that contain 3D graphics through a helper library called ANGLE. ANGLE takes the drawing instructions a web page gives it and translates them into instructions the computer's graphics card understands. One part of ANGLE, called VertexArrayGL, has the job of copying the shape data a page supplies into a temporary storage area (a buffer) in the graphics process before a drawing command runs.
A buffer is just a fixed-size block of memory, like a row of numbered boxes. You can only safely write into the boxes you reserved. If you keep writing past the last box, you spill into memory that belongs to something else. That is what security people call a buffer overflow, and when the buffer sits in a region of memory called the heap, it is a heap buffer overflow.
In this report, a special compatibility fix inside ANGLE (a workaround, meaning a piece of code added to cope with a known quirk) changes the number of vertices (corner points of a shape) that need copying after the buffer has already been sized for the original number. The copy loop then writes more data than the buffer can hold. The result is a crash of the GPU process, the separate process Chrome uses to talk to the graphics hardware. The bug can be triggered from ordinary WebGL code, which is the JavaScript interface web pages use to draw 3D graphics in the browser.
Context
ANGLE is the translation layer Chrome uses to run WebGL and OpenGL ES on top of the platform's native graphics API. To unpack that:
- An API (Application Programming Interface) is a defined set of commands one piece of software can send to another. Think of it as a menu: you can only order what is on it, but you do not need to know how the kitchen works.
- WebGL is the API a web page uses from JavaScript to draw 3D graphics in the browser.
- OpenGL ES is a graphics API used on many devices, especially phones.
- The native graphics API is whatever the operating system itself provides for talking to the graphics card (for example, on macOS or Windows).
ANGLE sits in the middle: the page speaks WebGL, and ANGLE translates that into whatever the operating system's graphics system understands.
On the GL backend (the version of ANGLE that talks to the system's OpenGL implementation), the class rx::VertexArrayGL is responsible for taking client-side vertex data supplied by the page and streaming it into a GPU buffer before a draw call. In plain terms:
- Vertex data is the list of points that make up a shape.
- Client-side means the data lives in the page's own memory rather than already being on the graphics card.
- Streaming means copying it across into a buffer the graphics card can use, just before drawing.
When the source and destination layouts differ, streamAttributes() falls back to a slow path that copies each vertex with memcpy into a buffer sized ahead of time. memcpy is a standard C function that copies a block of bytes from one place to another. The slow path is a simple loop that copies one vertex at a time, rather than a faster bulk operation.
One of ANGLE's workarounds, shiftInstancedArrayDataWithOffset, adjusts how instanced array data is laid out when a draw starts at a non-zero first index. Two terms to explain:
- Instancing is a graphics technique where the same shape is drawn many times in one command, each copy slightly different (for example, a field of grass).
- The
firstindex is the position in the vertex list where the draw should begin. Afirstof 0 means start at the beginning; afirstof 100 means skip the first 100 vertices.
The report shows that this workaround changes the vertex count after the streaming buffer has already been allocated, so the copy loop writes past the end of the heap allocation. The bug lives in the GPU process (the separate Chrome process that handles graphics) and is reachable from WebGL through drawArraysInstanced with first > 0. drawArraysInstanced is the WebGL command that draws an instanced shape starting from a given vertex.
The affected file is:
third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
This is a path inside the Chromium source tree. third_party/angle is where the ANGLE library lives inside Chrome's code; libANGLE/renderer/gl is the GL backend; VertexArrayGL.cpp is the source file that contains the buggy code.
The buggy lines are 492-496 (where the count is increased) and 548-554 (where the copy uses the increased count).
Setup
The researcher tested Chromium 148.0.7762.0 at commit 371e35b061, using an AddressSanitizer build of Chrome. AddressSanitizer (ASAN) is a tool built into a special debug version of a program that watches memory accesses and shouts loudly the moment a program reads or writes outside the memory it was given. It is like a smoke alarm for memory bugs: it does not prevent the fire, but it tells you exactly where it started.
The default reproduction platform is macOS Intel (non-Haswell), but the report states the bug is reproducible on any platform as long as the shiftInstancedArrayDataWithOffset feature is enabled.
No accounts, roles or special privileges are involved. The only precondition is a build with ASAN and the ability to launch Chrome with the flags below, plus a poc.html page that issues the WebGL draw. A PoC (proof of concept) is a minimal example that demonstrates a bug.
Finding it
The report describes an ordering problem in the streaming path:
computeStreamingAttributeSizes()computesstreamingDataSizefrom the original vertex count returned byComputeVertexBindingElementCount().- The buffer is allocated with that original size via
bufferData(GL_ARRAY_BUFFER, requiredBufferSize, ...). - The
shiftInstancedArrayDataWithOffsetworkaround then increasesstreamedVertexCount. - The slow-path copy loop iterates over the increased count and writes past the end of the allocation.
In everyday terms: someone measures how big a box needs to be, builds the box, then later decides there are more items to put in it, and keeps stuffing items in anyway. The box does not grow.
The slow path is only taken when sourceStride != destStride, for example a vertex attribute declared with stride 20 for a vec4 that packs down to 16 bytes. A stride is the number of bytes between the start of one vertex and the start of the next in memory. A vec4 is a four-component vector (four numbers, often x, y, z, w). If the source layout uses 20 bytes per vertex but the destination layout only needs 16, the two layouts differ, and that mismatch is what makes the copy loop run at all.
Exploitation
Step 1: launch Chrome with the workaround enabled
The researcher runs an ASAN build of Chrome headless with the ANGLE GL backend and the workaround feature explicitly enabled:
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:print_stacktrace=1 \
out/asan/chrome \
--no-sandbox \
--headless=new \
--use-angle=gl \
--ozone-platform=headless \
--no-first-run \
--disable-background-networking \
--disable-sync \
--disable-extensions \
--ignore-gpu-blocklist \
--enable-angle-features=shiftInstancedArrayDataWithOffset \
--virtual-time-budget=20000 \
poc.html
Line by line:
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:print_stacktrace=1sets options for AddressSanitizer.detect_leaks=0turns off leak detection (we are not looking for memory leaks here).halt_on_error=1tells the program to stop immediately on the first error, so the crash is caught at the exact moment.print_stacktrace=1asks ASAN to print the stack trace, which is the list of function calls that led to the error, like a receipt showing every step that led to the till.out/asan/chromeis the path to the ASAN build of Chrome.out/asanis the build output directory.--no-sandboxdisables Chrome's sandbox, the isolation layer that normally restricts what a process can do. It is used here because the test is running a debug build in a controlled environment.--headless=newruns Chrome without a visible window. Useful for automated tests.--use-angle=glselects the GL backend of ANGLE, which is where the bug lives.--ozone-platform=headlesstells Chrome's windowing layer (Ozone) to use the headless platform, matching the headless mode.--no-first-runskips the first-run setup screens.--disable-background-networkingstops Chrome from making background network requests, keeping the test quiet and reproducible.--disable-syncturns off Chrome's account sync feature.--disable-extensionsturns off browser extensions, so nothing else interferes.--ignore-gpu-blocklisttells Chrome to use the GPU even if it is on Chrome's list of known-problematic hardware.--enable-angle-features=shiftInstancedArrayDataWithOffsetturns on the specific ANGLE workaround that triggers the count increase. This is the key flag.--virtual-time-budget=20000gives the page 20,000 milliseconds of virtual time. Virtual time is a testing trick: instead of waiting in real time, Chrome advances a simulated clock quickly, so timers and animations run fast. This gives the page enough virtual time to run the draw.poc.htmlis the page to load, which contains the WebGL code that triggers the bug.
The important flags are --use-angle=gl (selects the GL backend where the bug lives), --enable-angle-features=shiftInstancedArrayDataWithOffset (turns on the workaround that triggers the count increase), and the ASAN options that halt on the first error and print a stack trace. --virtual-time-budget=20000 gives the page enough virtual time to run the draw.
Step 2: trigger the draw from WebGL
The draw reaches GL_DrawArraysInstanced in the GPU process, which dispatches through gl::Context::drawArraysInstanced, rx::ContextGL::drawArraysInstanced, rx::VertexArrayGL::syncClientSideData, rx::VertexArrayGL::syncDrawState, and finally rx::VertexArrayGL::streamAttributes. That call reaches GL_DrawArraysInstanced in the GPU process, which dispatches through gl::Context::drawArraysInstanced, rx::ContextGL::drawArraysInstanced, rx::VertexArrayGL::syncClientSideData, rx::VertexArrayGL::syncDrawState, and finally rx::VertexArrayGL::streamAttributes. The copy loop at line 553 runs with the inflated count and ASAN reports the overflow.
In plain terms: the page asks the browser to draw an instanced shape starting at a vertex other than the first. That request travels from the page, through Chrome's command buffer (a queue of graphics commands sent to the GPU process), into ANGLE, and down to the copy loop. Because the workaround has already increased the count, the loop copies more vertices than the buffer can hold.
Step 3: observe the crash
The crash state reported by ASAN:
==500925==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7186c57fd230 at pc 0x631b84c7600b bp 0x7ffc2b03d690 sp 0x7ffc2b03ce50
READ of size 16 at 0x7186c57fd230 thread T0 (chrome)
#0 0x631b84c7600a in __asan_memcpy (/home/calysteon/chromium/src/out/asan/chrome+0x196e900a) (BuildId: 330ba48cdf0bd5aa)
#1 0x6ee6ba61f271 in rx::VertexArrayGL::streamAttributes(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, gl::IndexRange const&, bool) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:553:21
#2 0x6ee6ba61beb5 in rx::VertexArrayGL::syncDrawState(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, int, gl::DrawElementsType, void const*, int, bool, void const**) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:264:27
#3 0x6ee6ba61b6de in rx::VertexArrayGL::syncClientSideData(gl::Context const*, angle::BitSetT<16ul, unsigned long, unsigned long> const&, int, int, int) const third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:180:12
#4 0x6ee6ba4e5453 in rx::ContextGL::drawArraysInstanced(gl::Context const*, gl::PrimitiveMode, int, int, int) third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp:266:26
#5 0x6ee6b9f7c6d8 in gl::Context::drawArraysInstanced(gl::PrimitiveMode, int, int, int) third_party/angle/src/libANGLE/Context.cpp:2961:26
#6 0x6ee6b9779072 in GL_DrawArraysInstanced third_party/angle/src/libGLESv2/entry_points_gles_3_0_autogen.cpp:1132:22
#7 0x631bad5b541d in gpu::gles2::GLES2DecoderImpl::HandleDrawArraysInstancedANGLE(unsigned int, void const volatile*) gpu/command_buffer/service/<gles2_cmd_decoder.cc:9429>:18
#8 0x631bad5fbd19 in gpu::error::Error gpu::gles2::GLES2DecoderImpl::DoCommandsImpl<false>(unsigned int, void const volatile*, int, int*) gpu/command_buffer/service/<gles2_cmd_decoder.cc:4766>:18
#9 0x631b93ed348d in gpu::CommandBufferService::Flush(int, gpu::AsyncAPIInterface*) gpu/command_buffer/service/<command_buffer_service.cc:267>:35
#10 0x631bad49be45 in gpu::CommandBufferStub::OnAsyncFlush(int, unsigned int, std::__Cr::vector<gpu::SyncToken, std::__Cr::allocator<gpu::SyncToken>> const&) gpu/ipc/service/<command_buffer_stub.cc:504>:22
#11 0x631bad49ae36 in gpu::CommandBufferStub::ExecuteDeferredRequest(gpu::mojom::DeferredCommandBufferRequestParams&, gpu::FenceSyncReleaseDelegate*) gpu/ipc/service/<command_buffer_stub.cc:173>:7
#12 0x631bad4c5a1b in gpu::GpuChannel::ExecuteDeferredRequest(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*) gpu/ipc/service/<gpu_channel.cc:833>:13
#13 0x631bad4d3f17 in void base::internal::DecayedFunctorTraits<void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>&&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&>::Invoke<void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel> const&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*>(void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel> const&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&, gpu::FenceSyncReleaseDelegate*&&) base/functional/bind_internal.h:740:12
#14 0x631bad4d3cf9 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::*&&)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>&&, mojo::StructPtr<gpu::mojom::DeferredRequestParams>&&>, base::internal::BindState<true, true, false, void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate*), base::WeakPtr<gpu::GpuChannel>, mojo::StructPtr<gpu::mojom::DeferredRequestParams>>, void (gpu::FenceSyncReleaseDelegate*)>::RunOnce(base::internal::BindStateBase*, gpu::FenceSyncReleaseDelegate*) base/functional/bind_internal.h:956:5
#15 0x631b93f20bb8 in base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>::Run(gpu::FenceSyncReleaseDelegate*) && base/functional/callback.h:155:12
#16 0x631b93f2092a in void base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>&&, gpu::FenceSyncReleaseDelegate*>, base::internal::BindState<false, true, true, base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>, base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunImpl<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>, std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, 0ul>(base::OnceCallback<void (gpu::FenceSyncReleaseDelegate*)>&&, std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>&&, std::__Cr::integer_sequence<unsigned long, 0ul>) base/functional/bind_internal.h:815:49
#17 0x631b85572945 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#18 0x631b93eee378 in gpu::Scheduler::ExecuteSequence(base::IdType<gpu::SyncPointOrderData, unsigned int, 0u, 1u>) gpu/command_buffer/service/<scheduler.cc:707>:29
#19 0x631b93eeba79 in gpu::Scheduler::RunNextTask() gpu/command_buffer/service/<scheduler.cc:625>:3
#20 0x631b93ef0af1 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::Scheduler::*&&)(), gpu::Scheduler*>, base::internal::BindState<true, true, false, void (gpu::Scheduler::*)(), base::internal::UnretainedWrapper<gpu::Scheduler, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunOnce(base::in
How to read this:
- The first line says ASAN detected a heap-buffer-overflow at a particular memory address.
READ of size 16means the program tried to read 16 bytes from that address, and those 16 bytes were outside the memory it was allowed to touch.thread T0 (chrome)says it happened on the main thread of the Chrome process. - Each numbered line (
#0,#1, ...) is one step in the call stack: the function that was running, and the function that called it, and so on back to the start of the program. Reading from top to bottom is like reading a receipt from the last item back to the first. #0is__asan_memcpy, the ASAN-instrumented version ofmemcpy. This is where the illegal read happened.#1isrx::VertexArrayGL::streamAttributesatVertexArrayGL.cpp:553:21, the copy loop in the buggy file.#2through#6show the path back up through ANGLE:syncDrawState,syncClientSideData,ContextGL::drawArraysInstanced,gl::Context::drawArraysInstanced, andGL_DrawArraysInstanced.#7and#8are in Chrome's command buffer decoder (gles2_cmd_decoder.cc), which receives graphics commands from the page.#9through#12are in the command buffer service and GPU channel, the plumbing that carries commands to the GPU process.#13through#27are Chrome's internal task scheduling and message loop machinery.#28through#34are the GPU process startup path (GpuMain,RunZygote,ContentMain,ChromeMain).#35and#36are the C library startup functions.- The final
SUMMARYline repeats the key finding: a heap-buffer-overflow in__asan_memcpy.
The top frame is __asan_memcpy, called from VertexArrayGL::streamAttributes at VertexArrayGL.cpp:553:21. The call chain confirms the path from the WebGL entry point (GL_DrawArraysInstanced) through the command buffer decoder into ANGLE and down to the copy loop. The crash is a GPU process crash.
Root cause
The allocation and the copy disagree about how many vertices to handle.
Line 415: computeStreamingAttributeSizes() computes streamingDataSize using the original vertex count from ComputeVertexBindingElementCount().
Line 438: the buffer is allocated with that original size:
bufferData(GL_ARRAY_BUFFER, requiredBufferSize, ...)
bufferData is the OpenGL command that creates a buffer of a given size. GL_ARRAY_BUFFER is the type of buffer used for vertex data. requiredBufferSize is the size computed from the original vertex count. The ... stands for other arguments not shown.
Lines 495-496: the workaround increases the vertex count:
streamedVertexCount = (instanceCount + indexRange.start() + adjustedDivisor - 1u) / adjustedDivisor;
This line recalculates how many vertices need to be streamed. instanceCount is the number of instances being drawn, indexRange.start() is the starting index, adjustedDivisor is a divisor used for instancing, and the - 1u and division round the result up. The key point is that the result can be larger than the original count.
Lines 548-554: the slow-path copy loop uses the increased count:
for (size_t vertexIdx = 0; vertexIdx < streamedVertexCount; vertexIdx++) {
uint8_t *out = bufferPointer + curBufferOffset + (destStride * vertexIdx);
const uint8_t *in = inputPointer + sourceStride * (vertexIdx + firstIndexForSeparateCopy);
memcpy(out, in, destStride);
}
Line by line:
for (size_t vertexIdx = 0; vertexIdx < streamedVertexCount; vertexIdx++) {starts a loop that runs once per vertex, from 0 up tostreamedVertexCount(the increased count).uint8_t *out = bufferPointer + curBufferOffset + (destStride * vertexIdx);calculates where in the destination buffer this vertex should go.uint8_tis a single byte;uint8_t *is a pointer to bytes.bufferPointeris the start of the buffer,curBufferOffsetis how far into it we are, anddestStride * vertexIdxskips forward by one vertex's worth of bytes for each iteration.const uint8_t *in = inputPointer + sourceStride * (vertexIdx + firstIndexForSeparateCopy);calculates where in the source data to read from.inputPointeris the start of the source,sourceStrideis the number of bytes per source vertex, andfirstIndexForSeparateCopyis the starting offset.memcpy(out, in, destStride);copiesdestStridebytes from the source to the destination. This is the actual copy.}closes the loop.
With first=100, instanceCount=1024 and divisor=1, the original count is 1024 and the new count is 1124. The buffer is sized for 1024 vertices, but the loop writes 1124. The overflow is 100 * destStride bytes.
The slow path is taken when sourceStride != destStride, for example a vertex attribute with stride 20 for a vec4 that packs to 16. Without that mismatch the copy loop does not run and the overflow does not occur.
Impact
The report classifies this as a heap buffer overflow in the GPU process, reachable from WebGL via drawArraysInstanced with first > 0. The immediate effect is a GPU process crash. The report does not describe any further exploitation, such as controlled writes or sandbox escape, and does not state what an attacker could achieve beyond the crash. In the report's example the overflow is 100 * destStride bytes.
In plain terms: the worst outcome described in the report is that the graphics process crashes. A crash can make the page or the browser tab misbehave, but the report does not claim anything more serious than that.
Fix
The suggested fix is in streamAttributes(): after the workaround modifies streamedVertexCount at lines 495-496, recompute batchMemcpySize and make sure the buffer allocation at line 438 accounts for the maximum possible vertex count. The report does not state whether a patch was applied or which change landed.
In everyday terms: measure the box again after you know how many items you are actually going to put in it, and build it big enough the second time.
Each is a way of asking "does the same kind of mistake happen elsewhere?"
- Other workarounds that adjust counts after allocation. Look for any ANGLE feature flag that changes vertex or instance counts after
computeStreamingAttributeSizes()has run. A positive result is an ASAN heap-buffer-overflow instreamAttributeswith the flag enabled. - Different stride mismatches. Try attribute layouts where
sourceStride != destStride(for example avec4declared with stride 20 packing to 16). A positive result is the slow-path copy loop being reached and the overflow appearing at line 553. - Larger
firstvalues. Increasefirstwhile keepinginstanceCountanddivisorfixed. A positive result is a larger reported overflow size, consistent withfirst * destStride. - Other draw entry points. Test
drawElementsInstancedand related instanced draws with a non-zero starting index. A positive result is the same crash state reached through a different entry point in the stack. - Platforms other than macOS Intel. Run the same PoC on other platforms with
--enable-angle-features=shiftInstancedArrayDataWithOffset. A positive result is the same ASAN report, confirming the bug is not platform-specific.
Glossary
- ANGLE: the translation layer Chrome uses to run WebGL and OpenGL ES on top of the platform's native graphics API.
- API: a defined set of commands one piece of software can send to another.
- AddressSanitizer (ASAN): a debugging tool built into a special build of a program that detects out-of-bounds memory accesses and reports them with a stack trace.
- Buffer: a fixed-size block of memory used to hold data temporarily.
- Buffer overflow: writing more data into a buffer than it can hold, so the extra data spills into neighbouring memory.
- Call stack / stack trace: the list of function calls that led to the current point in a program, from the most recent call back to the start.
- Client-side vertex data: vertex data that lives in the page's own memory rather than already on the graphics card.
- Command buffer: a queue of graphics commands Chrome sends from the page to the GPU process.
- Commit: a specific saved version of a code repository, identified by a short hash.
destStride: the number of bytes per vertex in the destination buffer.- Divisor: in instancing, a number that controls how often a per-instance attribute advances.
drawArraysInstanced: the WebGL command that draws an instanced shape starting from a given vertex.drawElementsInstanced: a related WebGL command that draws instanced shapes using an index list.firstindex: the position in the vertex list where a draw begins.- GPU process: the separate Chrome process that handles graphics and talks to the graphics hardware.
- Heap: a region of memory a program uses for dynamic allocations at runtime.
- Heap buffer overflow: a buffer overflow in memory allocated on the heap.
- Instancing: a graphics technique where the same shape is drawn many times in one command.
memcpy: a standard C function that copies a block of bytes from one place to another.- Native graphics API: the graphics interface provided by the operating system itself.
- OpenGL ES: a graphics API used on many devices, especially phones.
- PoC (proof of concept): a minimal example that demonstrates a bug.
- Sandbox: an isolation layer that restricts what a process can do.
- Slow path: a simpler, slower code path taken when a faster bulk operation cannot be used.
- Source stride: the number of bytes per vertex in the source data.
- Stride: the number of bytes between the start of one vertex and the start of the next in memory.
vec4: a four-component vector, often x, y, z, w.- Vertex: a corner point of a shape.
- Virtual time: a testing trick where Chrome advances a simulated clock quickly instead of waiting in real time.
- WebGL: the API a web page uses from JavaScript to draw 3D graphics in the browser.
- Workaround: a piece of code added to cope with a known quirk or limitation.