Heap buffer overflow in ANGLE (CVE-2026-7900)
A heap buffer overflow exists in ANGLE's Vulkan backend CPU vertex conversion path, where the copy length is computed from the whole buffer capacity rather than the dirty range size. A compromised renderer could request a non-WebGL context type to bypass alignment checks and trigger an out-of-bounds write in the GPU process.
- Fix shipped in 41 days
VULNERABILITY DETAILS
A heap-buffer-overflow exists in the ANGLE Vulkan backend's CPU-side vertex format conversion path. When a partial buffer update (via bufferSubData) dirties only a small range of a large vertex buffer, the subsequent convertVertexBufferCPU function computes the copy length using the total buffer capacity instead of the dirty range size, causing an out-of-bounds write into the conversion buffer.
In convertVertexBufferCPU, when the conversion buffer is not entirely dirty, the function iterates over dirty ranges [0]:
const std::vector<RangeDeviceSize> &dirtyRanges = conversion->getDirtyBufferRanges();
for (const RangeDeviceSize &dirtyRange : dirtyRanges) // [0]
{
if (dirtyRange.empty())
{
// consolidateDirtyRanges may end up with invalid range if it gets merged.
continue;
}
uint32_t srcOffset, dstOffset, numVertices;
CalculateOffsetAndVertexCountForDirtyRange(srcBuffer, conversion, srcFormat, dstFormat,
dirtyRange, &srcOffset, &dstOffset,
&numVertices);
if (numVertices > 0)
{
const uint8_t *srcBytes = src + srcOffset;
size_t bytesToCopy = maxNumVertices * dstFormat.pixelBytes; // [1]
ANGLE_TRY(StreamVertexData(contextVk, conversion->getBuffer(), srcBytes, // [2]
bytesToCopy, dstOffset, maxNumVertices, srcStride,
vertexLoadFunction));
}
}
CalculateOffsetAndVertexCountForDirtyRange computes dstOffset based on where the dirty range begins within the buffer — when the dirty range is near the end of the buffer, dstOffset points near the end of the conversion buffer.
However, bytesToCopy at [1] is computed from maxNumVertices, which represents the total vertex count derived from the entire buffer capacity. The conversion buffer is allocated with exactly maxNumVertices * dstFormat.pixelBytes bytes. When StreamVertexData is called at [2], vertexLoadFunction copies maxNumVertices vertices starting from dstOffset into the conversion buffer, writing far past the buffer's end.
StreamVertexData writes directly to the destination buffer at the given offset [3]:
uint8_t *dst = dstBufferHelper->getMappedMemory() + dstOffset;
if (vertexLoadFunction != nullptr)
{
vertexLoadFunction(srcData, srcStride, vertexCount, dst); // [3]
}
The conversion buffer is allocated with maxNumVertices * dstStride bytes via CalculateMaxVertexCountForConversion [4]:
ANGLE_TRY(contextVk->initBufferForVertexConversion(conversion, maxNumVertices * dstStride, // [4]
hostVisible));
So when dstOffset is near the end and the copy length equals the full buffer size, the write overflows the conversion buffer heap allocation.
To reach the vulnerable CPU conversion path, the vertex attribute stride or offset must be unaligned with the format's component size, causing bindingIsAligned to evaluate to false. This triggers the CPU fallback path in syncNeedsConversionAttrib [5]:
if (bindingIsAligned)
{
ANGLE_TRY(
convertVertexBufferGPU(contextVk, bufferVk, conversion, srcFormat, dstFormat));
}
else
{
ANGLE_VK_PERF_WARNING(contextVk, GL_DEBUG_SEVERITY_HIGH,
"GPU stall due to vertex format conversion of unaligned data");
ANGLE_TRY(convertVertexBufferCPU(contextVk, bufferVk, conversion, srcFormat, dstFormat, // [5]
vertexFormat.getVertexLoadFunction()));
}
WebGL contexts enforce stride/offset alignment via ValidateWebGLVertexAttribPointer, blocking this path. However, a compromised renderer can request an OPENGLES2 context type instead of CONTEXT_TYPE_WEBGL1/2 when creating the GPU command buffer — CONTEXT_TYPE_OPENGLES2 is a legitimate context type that is fully supported by the IPC serialization layer and GPU service. With isWebGL() returning false, the alignment validation is bypassed, and unaligned stride/offset values reach the Vulkan backend.
BISECTION
Introduced by ANGLE commit [0] which added fine-grained dirty range tracking for vertex buffer conversion but incorrectly used the full-buffer vertex count (maxNumVertices) instead of the dirty-range vertex count (numVertices) when computing the copy size.
This was rolled into Chromium in commit [1].
[0] https://chromium.googlesource.com/angle/angle/+/53476d6ff2740267db0c0573644378621c4e7d78
[1] https://chromium.googlesource.com/chromium/src/+/2580fab69bf8f219b97a3e812122dca566c525e0
VERSION
Chrome Version: HEAD
Operating System: Linux
REPRODUCTION CASE
This vulnerability requires a compromised renderer. The attached renderer.patch modifies the renderer process to request CONTEXT_TYPE_OPENGLES2 instead of WebGL context types, bypassing WebGL alignment checks.
- Apply the renderer patch and build Chromium with ASan.
- Host
poc.htmlon an HTTP server. - Run Chrome against the PoC.
$ git apply renderer.patch && autoninja -C out/asan chrome
$ python3 -m http.server
$ ./out/asan/chrome --use-angle=vulkan "http://localhost:8000/poc.html"
CRASH INFORMATION
Type of crash: GPU process
Crash log: see the attached asan.txt ASan trace.
CREDIT INFORMATION
Reporter credit: Anonymous
Context
This report describes a heap buffer overflow in ANGLE, the graphics translation layer that Chromium uses to map OpenGL ES and WebGL calls onto platform graphics APIs. The affected component is the ANGLE Vulkan backend, specifically the CPU-side vertex format conversion path in VertexArrayVk.cpp.
ANGLE sometimes has to convert vertex data from one format to another before it can be handed to the GPU. When a vertex attribute's stride or offset is not aligned with the destination format's component size, the backend cannot do the conversion on the GPU and falls back to a CPU conversion routine, convertVertexBufferCPU. That routine writes converted vertices into a separate conversion buffer allocated on the host. The bug is in how the length of that write is calculated when only part of the source vertex buffer has been updated.
The report is an advisory from the Chrome VRP. The researcher is listed as Anonymous, the severity is high, the weakness is a heap buffer overflow, and the bounty was 16,000 USD. It was disclosed on 2026-05-05.
Setup
The vulnerability requires a compromised renderer. The report states this explicitly: the attacker is assumed to already control the renderer process, and the bug is what that compromised renderer can do to the GPU process.
The reproduction environment is:
- Chrome Version: HEAD
- Operating System: Linux
- A Chromium build with ASan enabled
- The attached
renderer.patch, which modifies the renderer process to requestCONTEXT_TYPE_OPENGLES2instead of the WebGL context types - A PoC page,
poc.html, served over HTTP
The report does not give the contents of renderer.patch, poc.html or asan.txt; it only refers to them as attachments.
Finding it
The researcher identified a mismatch between two quantities used in the same copy operation inside convertVertexBufferCPU. When the conversion buffer is not entirely dirty, the function iterates over the dirty ranges:
const std::vector<RangeDeviceSize> &dirtyRanges = conversion->getDirtyBufferRanges();
for (const RangeDeviceSize &dirtyRange : dirtyRanges) // [0]
{
if (dirtyRange.empty())
{
// consolidateDirtyRanges may end up with invalid range if it gets merged.
continue;
}
uint32_t srcOffset, dstOffset, numVertices;
CalculateOffsetAndVertexCountForDirtyRange(srcBuffer, conversion, srcFormat, dstFormat,
dirtyRange, &srcOffset, &dstOffset,
&numVertices);
if (numVertices > 0)
{
const uint8_t *srcBytes = src + srcOffset;
size_t bytesToCopy = maxNumVertices * dstFormat.pixelBytes; // [1]
ANGLE_TRY(StreamVertexData(contextVk, conversion->getBuffer(), srcBytes, // [2]
bytesToCopy, dstOffset, maxNumVertices, srcStride,
vertexLoadFunction));
}
}
CalculateOffsetAndVertexCountForDirtyRange computes dstOffset from where the dirty range begins within the buffer. When the dirty range sits near the end of the buffer, dstOffset points near the end of the conversion buffer.
However, bytesToCopy at [1] is computed from maxNumVertices, which is the total vertex count derived from the entire buffer capacity, not from the dirty range. The conversion buffer is allocated with exactly maxNumVertices * dstFormat.pixelBytes bytes. When StreamVertexData is called at [2], vertexLoadFunction copies maxNumVertices vertices starting from dstOffset, which writes far past the end of the conversion buffer.
The write itself happens in StreamVertexData, which writes directly to the destination buffer at the given offset:
uint8_t *dst = dstBufferHelper->getMappedMemory() + dstOffset;
if (vertexLoadFunction != nullptr)
{
vertexLoadFunction(srcData, srcStride, vertexCount, dst); // [3]
}
The conversion buffer is allocated with maxNumVertices * dstStride bytes via CalculateMaxVertexCountForConversion:
ANGLE_TRY(contextVk->initBufferForVertexConversion(conversion, maxNumVertices * dstStride, // [4]
hostVisible));
So when dstOffset is near the end and the copy length equals the full buffer size, the write overflows the conversion buffer's heap allocation.
The trigger condition is a partial buffer update. A bufferSubData call that dirties only a small range of a large vertex buffer leaves the conversion buffer only partially dirty, which is what sends execution into the dirty-range loop above. The report does not give the exact size of the buffer or the dirty range used in the PoC.
Exploitation
Step 1: Reach the CPU conversion path
To reach the vulnerable CPU conversion path, the vertex attribute stride or offset must be unaligned with the format's component size, so that bindingIsAligned evaluates to false. That triggers the CPU fallback in syncNeedsConversionAttrib:
if (bindingIsAligned)
{
ANGLE_TRY(
convertVertexBufferGPU(contextVk, bufferVk, conversion, srcFormat, dstFormat));
}
else
{
ANGLE_VK_PERF_WARNING(contextVk, GL_DEBUG_SEVERITY_HIGH,
"GPU stall due to vertex format conversion of unaligned data");
ANGLE_TRY(convertVertexBufferCPU(contextVk, bufferVk, conversion, srcFormat, dstFormat, // [5]
vertexFormat.getVertexLoadFunction()));
}
Step 2: Bypass the WebGL alignment validation
WebGL contexts enforce stride and offset alignment through ValidateWebGLVertexAttribPointer, which blocks this path. The bypass is to avoid a WebGL context altogether. A compromised renderer can request an OPENGLES2 context type instead of CONTEXT_TYPE_WEBGL1 or CONTEXT_TYPE_WEBGL2 when creating the GPU command buffer. CONTEXT_TYPE_OPENGLES2 is a legitimate context type that is fully supported by the IPC serialisation layer and the GPU service. With isWebGL() returning false, the alignment validation is bypassed, and unaligned stride and offset values reach the Vulkan backend.
Step 3: Dirty a small range of a large buffer
With the unaligned attribute in place, a partial buffer update via bufferSubData dirties only a small range of a large vertex buffer. The conversion buffer is then only partially dirty, and the dirty-range loop runs with a dstOffset near the end of the conversion buffer while bytesToCopy still reflects the full buffer capacity. The copy overflows the heap allocation.
Step 4: Build and run the PoC
The report gives the following commands for the reproduction case:
$ git apply renderer.patch && autoninja -C out/asan chrome
$ python3 -m http.server
$ ./out/asan/chrome --use-angle=vulkan "http://localhost:8000/poc.html"
The first command applies the renderer patch and builds Chromium with ASan. The second serves the PoC page from the current directory over HTTP on port 8000. The third launches the ASan build of Chrome with the Vulkan ANGLE backend and loads the PoC from http://localhost:8000/poc.html.
The report does not include the contents of poc.html, so the exact WebGL or GLES calls used to set up the unaligned attribute and the partial buffer update are not shown.
Step 5: Observe the crash
The crash type is the GPU process. The crash log is the attached asan.txt ASan trace, which the report does not reproduce inline.
Root cause
The mistake is in the copy length calculation. CalculateOffsetAndVertexCountForDirtyRange correctly computes numVertices for the dirty range and a matching dstOffset, but the code then ignores numVertices when sizing the copy. At [1] it uses maxNumVertices, the vertex count for the whole buffer, so bytesToCopy equals the full conversion buffer size. StreamVertexData is then asked to write maxNumVertices vertices starting at a dstOffset that can be near the end of the buffer, which overruns the allocation made at [4].
The bisection section attributes the bug to an ANGLE commit that added fine-grained dirty range tracking for vertex buffer conversion but incorrectly used the full-buffer vertex count (maxNumVertices) instead of the dirty-range vertex count (numVertices) when computing the copy size. That change was rolled into Chromium in a second commit. The report gives the two commits as links, with their hashes in the URLs.
On defences: the WebGL alignment validation in ValidateWebGLVertexAttribPointer would normally prevent unaligned stride and offset values from reaching this path. It does not stop the attack because the validation is tied to the context type. The IPC serialisation layer and the GPU service both accept CONTEXT_TYPE_OPENGLES2 as a legitimate context type, so a compromised renderer can request it and make isWebGL() return false.
Impact
A compromised renderer can cause a heap buffer overflow in the GPU process. The write goes past the end of the conversion buffer allocation, which is a heap allocation in the GPU process. The precondition is explicit and significant: the attacker must already control the renderer process. The crash type reported is the GPU process.
Fix
Based on the root cause, the correction would be to size the copy from the dirty range, using numVertices rather than maxNumVertices when computing bytesToCopy and when passing the vertex count to StreamVertexData. The report does not confirm that this is what was done.
Variants to test
- Other partial-update paths in ANGLE's Vulkan backend. Look for code that iterates dirty ranges and sizes a copy from a whole-buffer quantity. A positive result is a copy length that exceeds the dirty range while the destination offset is derived from the dirty range.
- Other context types accepted by the IPC serialisation layer that make
isWebGL()return false. A positive result is a context type that reaches backend validation paths without the WebGL-specific checks applied. - Other validation routines gated on
isWebGL()rather than on the actual API surface. A positive result is a validation that can be skipped by requesting a non-WebGL context type while still issuing the same calls. - Other CPU fallbacks triggered by alignment checks, such as format conversion paths where
bindingIsAlignedis false. A positive result is a fallback that performs a write sized from a different quantity than the one used to compute the destination offset. - Dirty range consolidation logic. The code comments that
consolidateDirtyRangesmay produce an invalid range if ranges are merged, and the loop skips empty ranges. A positive result is a merged range that produces offsets or counts inconsistent with the allocation.
Each of these should be tested only in an environment where a compromised renderer is a valid part of the threat model, since the original bug depends on that precondition.
What happened, in plain words
A security researcher found a bug in a piece of software called ANGLE. ANGLE is a translator that sits between web pages and the graphics card. When a web page wants to draw something, it gives instructions in a language called WebGL. ANGLE translates those instructions into a language the graphics card understands, such as Vulkan. The bug is in the Vulkan backend of ANGLE, in the code that converts vertex data on the CPU.
The bug is a heap buffer overflow. Imagine a row of boxes on a shelf, each box holding a small amount of data. The program is supposed to put data only into the boxes it has reserved. A heap buffer overflow happens when the program writes data past the last reserved box, into boxes that belong to something else. That can corrupt other data or crash the program. In this case, the overflow happens in the GPU process, a separate part of the browser that handles graphics.
The report is an advisory from the Chrome VRP, a programme that pays people for finding security bugs in Chrome. The researcher is listed as Anonymous, the severity is high, and the bounty was 16,000 USD. It was disclosed on 2026-05-05.
One important condition: the attacker must already control the renderer process. The renderer is the part of the browser that turns web pages into what you see. If an attacker can run their own code inside the renderer, they can reach this bug and cause a heap overflow in the GPU process. The report assumes that precondition and describes what the compromised renderer can do.
Setup
The report says the vulnerability requires a compromised renderer. That means the attacker already has a way to run code in the renderer process. The bug is what that code can do to the GPU process.
The reproduction environment is:
- Chrome Version: HEAD
- Operating System: Linux
- A Chromium build with ASan enabled
- The attached
renderer.patch, which modifies the renderer process to requestCONTEXT_TYPE_OPENGLES2instead of the WebGL context types - A PoC page,
poc.html, served over HTTP
ASan stands for AddressSanitizer. It is a tool built into the compiler that watches memory accesses while a program runs. When a program reads or writes outside the memory it reserved, ASan stops the program and prints a report. It is like a smoke detector for memory bugs: it does not prevent the fire, but it tells you exactly where it started.
A patch is a small file that describes changes to source code. The renderer.patch file changes the renderer so that it asks for a different kind of graphics context. A context is the environment in which graphics commands run. WebGL contexts have extra safety checks; an OpenGL ES 2 context is a more general type that does not have those WebGL-specific checks.
The report does not give the contents of renderer.patch, poc.html or asan.txt; it only refers to them as attachments.
Finding it
The researcher found a mismatch between two numbers used in the same copy operation inside a function called convertVertexBufferCPU. That function converts vertex data on the CPU. Vertex data describes the corners of shapes: positions, colours, and so on. Sometimes the data is in a format the GPU cannot use directly, so ANGLE converts it first.
When only part of the conversion buffer has been updated, the function loops over the ranges that changed. Those ranges are called dirty ranges. The code looks like this:
const std::vector<RangeDeviceSize> &dirtyRanges = conversion->getDirtyBufferRanges();
for (const RangeDeviceSize &dirtyRange : dirtyRanges) // [0]
{
if (dirtyRange.empty())
{
// consolidateDirtyRanges may end up with invalid range if it gets merged.
continue;
}
uint32_t srcOffset, dstOffset, numVertices;
CalculateOffsetAndVertexCountForDirtyRange(srcBuffer, conversion, srcFormat, dstFormat,
dirtyRange, &srcOffset, &dstOffset,
&numVertices);
if (numVertices > 0)
{
const uint8_t *srcBytes = src + srcOffset;
size_t bytesToCopy = maxNumVertices * dstFormat.pixelBytes; // [1]
ANGLE_TRY(StreamVertexData(contextVk, conversion->getBuffer(), srcBytes, // [2]
bytesToCopy, dstOffset, maxNumVertices, srcStride,
vertexLoadFunction));
}
}
Line by line:
const std::vector<RangeDeviceSize> &dirtyRanges = conversion->getDirtyBufferRanges();gets the list of ranges that have changed since the last conversion. Think of it as a list of dirty spots on a whiteboard.for (const RangeDeviceSize &dirtyRange : dirtyRanges) // [0]goes through each dirty range one by one.if (dirtyRange.empty())checks whether the range is empty. An empty range means there is nothing to copy.continue;skips to the next range if the current one is empty.uint32_t srcOffset, dstOffset, numVertices;declares three numbers: where to read from in the source, where to write to in the destination, and how many vertices to process.CalculateOffsetAndVertexCountForDirtyRange(...)fills in those three numbers for the current dirty range. It looks at where the dirty range starts and how many vertices it covers.if (numVertices > 0)checks that there is at least one vertex to convert.const uint8_t *srcBytes = src + srcOffset;sets a pointer to the start of the dirty data in the source buffer.size_t bytesToCopy = maxNumVertices * dstFormat.pixelBytes; // [1]calculates how many bytes to copy. Here is the bug: it usesmaxNumVertices, which is the total number of vertices in the whole buffer, notnumVertices, which is the number in the dirty range.dstFormat.pixelBytesis the size of one converted vertex in bytes.ANGLE_TRY(StreamVertexData(...))calls a function that does the actual copy. It passesbytesToCopy,dstOffset, andmaxNumVerticesas the vertex count.
The function CalculateOffsetAndVertexCountForDirtyRange computes dstOffset based on where the dirty range begins within the buffer. When the dirty range is near the end of the buffer, dstOffset points near the end of the conversion buffer.
However, bytesToCopy at [1] is computed from maxNumVertices, which is the total vertex count derived from the entire buffer capacity, not from the dirty range. The conversion buffer is allocated with exactly maxNumVertices * dstFormat.pixelBytes bytes. When StreamVertexData is called at [2], vertexLoadFunction copies maxNumVertices vertices starting from dstOffset, which writes far past the end of the conversion buffer.
The write itself happens in StreamVertexData, which writes directly to the destination buffer at the given offset:
uint8_t *dst = dstBufferHelper->getMappedMemory() + dstOffset;
if (vertexLoadFunction != nullptr)
{
vertexLoadFunction(srcData, srcStride, vertexCount, dst); // [3]
}
Line by line:
uint8_t *dst = dstBufferHelper->getMappedMemory() + dstOffset;gets a pointer to the destination buffer and moves it forward bydstOffsetbytes. This is where the writing will start.if (vertexLoadFunction != nullptr)checks that a conversion function exists.vertexLoadFunction(srcData, srcStride, vertexCount, dst); // [3]calls that function to convert and writevertexCountvertices fromsrcDataintodst. ThevertexCounthere ismaxNumVertices, the full buffer count.
The conversion buffer is allocated with maxNumVertices * dstStride bytes via CalculateMaxVertexCountForConversion:
ANGLE_TRY(contextVk->initBufferForVertexConversion(conversion, maxNumVertices * dstStride, // [4]
hostVisible));
Line by line:
ANGLE_TRY(...)calls a function and checks for errors.contextVk->initBufferForVertexConversion(conversion, maxNumVertices * dstStride, hostVisible)initialises the conversion buffer with a size ofmaxNumVertices * dstStridebytes.hostVisiblemeans the buffer is in memory the CPU can access.
So when dstOffset is near the end and the copy length equals the full buffer size, the write overflows the conversion buffer's heap allocation.
The trigger condition is a partial buffer update. A bufferSubData call that dirties only a small range of a large vertex buffer leaves the conversion buffer only partially dirty, which is what sends execution into the dirty-range loop above. bufferSubData is a WebGL function that updates part of a buffer. The report does not give the exact size of the buffer or the dirty range used in the PoC.
Exploitation
Step 1: Reach the CPU conversion path
To reach the vulnerable CPU conversion path, the vertex attribute stride or offset must be unaligned with the format's component size, so that bindingIsAligned evaluates to false. That triggers the CPU fallback in syncNeedsConversionAttrib:
if (bindingIsAligned)
{
ANGLE_TRY(
convertVertexBufferGPU(contextVk, bufferVk, conversion, srcFormat, dstFormat));
}
else
{
ANGLE_VK_PERF_WARNING(contextVk, GL_DEBUG_SEVERITY_HIGH,
"GPU stall due to vertex format conversion of unaligned data");
ANGLE_TRY(convertVertexBufferCPU(contextVk, bufferVk, conversion, srcFormat, dstFormat, // [5]
vertexFormat.getVertexLoadFunction()));
}
Line by line:
if (bindingIsAligned)checks whether the vertex data is aligned. Alignment means the data starts at an address that is a multiple of the component size. For example, a 4-byte component should start at an address divisible by 4. If it does not, the GPU cannot handle it directly.- If aligned,
convertVertexBufferGPU(...)does the conversion on the GPU. - If not aligned, the code prints a performance warning:
ANGLE_VK_PERF_WARNING(...)with the message "GPU stall due to vertex format conversion of unaligned data". This tells developers that the CPU fallback is slower. - Then it calls
convertVertexBufferCPU(...), the vulnerable function.
A vertex attribute is a piece of data per vertex, such as position or colour. Stride is the number of bytes between the start of one vertex and the start of the next. Offset is the number of bytes from the start of the vertex to the attribute. If either is not a multiple of the component size, the data is unaligned.
Step 2: Bypass the WebGL alignment validation
WebGL contexts enforce stride and offset alignment through ValidateWebGLVertexAttribPointer, which blocks this path. The bypass is to avoid a WebGL context altogether. A compromised renderer can request an OPENGLES2 context type instead of CONTEXT_TYPE_WEBGL1 or CONTEXT_TYPE_WEBGL2 when creating the GPU command buffer. CONTEXT_TYPE_OPENGLES2 is a legitimate context type that is fully supported by the IPC serialisation layer and the GPU service. With isWebGL() returning false, the alignment validation is bypassed, and unaligned stride and offset values reach the Vulkan backend.
IPC stands for inter-process communication. It is how different parts of the browser talk to each other. The renderer sends commands to the GPU process over IPC. The serialisation layer is the code that packs those commands into a format that can be sent. The GPU service is the part of the GPU process that receives and executes them.
ValidateWebGLVertexAttribPointer is a function that checks whether the vertex attribute pointer is valid for WebGL. It enforces alignment. But it only runs when the context is a WebGL context. If the renderer asks for an OpenGL ES 2 context, isWebGL() returns false, and the check is skipped.
Step 3: Dirty a small range of a large buffer
With the unaligned attribute in place, a partial buffer update via bufferSubData dirties only a small range of a large vertex buffer. The conversion buffer is then only partially dirty, and the dirty-range loop runs with a dstOffset near the end of the conversion buffer while bytesToCopy still reflects the full buffer capacity. The copy overflows the heap allocation.
Think of it like this: you have a large notebook, and you only change one line near the end. The program is supposed to copy just that line to a new notebook. Instead, it copies the entire notebook's worth of lines starting from that point, which goes past the end of the new notebook.
Step 4: Build and run the PoC
The report gives the following commands for the reproduction case:
$ git apply renderer.patch && autoninja -C out/asan chrome
$ python3 -m http.server
$ ./out/asan/chrome --use-angle=vulkan "http://localhost:8000/poc.html"
Line by line:
git apply renderer.patch && autoninja -C out/asan chromeapplies the patch to the source code and then builds Chromium with ASan.git applytakes a patch file and applies the changes.autoninjais a build tool that compiles the code.-C out/asantells it to build in theout/asandirectory, which is configured for ASan.chromeis the target to build.python3 -m http.serverstarts a simple web server on port 8000, serving files from the current directory. This is how the PoC page is made available../out/asan/chrome --use-angle=vulkan "http://localhost:8000/poc.html"runs the built Chrome with the Vulkan backend for ANGLE and opens the PoC page.--use-angle=vulkantells ANGLE to use Vulkan. The URL points to the local server.
The report does not include the contents of poc.html, so the exact WebGL or GLES calls used to set up the unaligned attribute and the partial buffer update are not shown.
Step 5: Observe the crash
The crash type is the GPU process. The crash log is the attached asan.txt ASan trace, which the report does not reproduce inline. An ASan trace is a report that shows the sequence of function calls that led to the memory error, along with the memory addresses involved.
Root cause
The mistake is in the copy length calculation. CalculateOffsetAndVertexCountForDirtyRange correctly computes numVertices for the dirty range and a matching dstOffset, but the code then ignores numVertices when sizing the copy. At [1] it uses maxNumVertices, the vertex count for the whole buffer, so bytesToCopy equals the full conversion buffer size. StreamVertexData is then asked to write maxNumVertices vertices starting at a dstOffset that can be near the end of the buffer, which overruns the allocation made at [4].
The bisection section attributes the bug to an ANGLE commit that added fine-grained dirty range tracking for vertex buffer conversion but incorrectly used the full-buffer vertex count (maxNumVertices) instead of the dirty-range vertex count (numVertices) when computing the copy size. That change was rolled into Chromium in a second commit. The report gives the two commits as links, with their hashes in the URLs.
Bisection is the process of finding the exact change that introduced a bug by testing versions between a known good one and a known bad one. A commit is a recorded change to the source code.
On defences: the WebGL alignment validation in ValidateWebGLVertexAttribPointer would normally prevent unaligned stride and offset values from reaching this path. It does not stop the attack because the validation is tied to the context type. The IPC serialisation layer and the GPU service both accept CONTEXT_TYPE_OPENGLES2 as a legitimate context type, so a compromised renderer can request it and make isWebGL() return false.
Impact
A compromised renderer can cause a heap buffer overflow in the GPU process. The write goes past the end of the conversion buffer allocation, which is a heap allocation in the GPU process. The precondition is explicit and significant: the attacker must already control the renderer process. The crash type reported is the GPU process.
Fix
Based on the root cause, the correction would be to size the copy from the dirty range, using numVertices rather than maxNumVertices when computing bytesToCopy and when passing the vertex count to StreamVertexData. The report does not confirm that this is what was done.
Variants to test
- Other partial-update paths in ANGLE's Vulkan backend. Look for code that iterates dirty ranges and sizes a copy from a whole-buffer quantity. A positive result is a copy length that exceeds the dirty range while the destination offset is derived from the dirty range.
- Other context types accepted by the IPC serialisation layer that make
isWebGL()return false. A positive result is a context type that reaches backend validation paths without the WebGL-specific checks applied. - Other validation routines gated on
isWebGL()rather than on the actual API surface. A positive result is a validation that can be skipped by requesting a non-WebGL context type while still issuing the same calls. - Other CPU fallbacks triggered by alignment checks, such as format conversion paths where
bindingIsAlignedis false. A positive result is a fallback that performs a write sized from a different quantity than the one used to compute the destination offset. - Dirty range consolidation logic. The code comments that
consolidateDirtyRangesmay produce an invalid range if ranges are merged, and the loop skips empty ranges. A positive result is a merged range that produces offsets or counts inconsistent with the allocation.
Each of these should be tested only in an environment where a compromised renderer is a valid part of the threat model, since the original bug depends on that precondition.
Glossary
- ANGLE: A translator that lets programs use OpenGL ES and WebGL on different graphics APIs, such as Vulkan.
- Heap buffer overflow: A memory bug where a program writes data past the end of a reserved block of memory, potentially corrupting other data.
- GPU process: A separate process in the browser that handles graphics operations.
- Renderer process: The part of the browser that turns web pages into what you see on screen.
- ASan (AddressSanitizer): A tool that detects memory errors such as out-of-bounds accesses during program execution.
- Patch: A file that describes changes to source code.
- Context: The environment in which graphics commands run, such as WebGL or OpenGL ES.
- WebGL: A JavaScript API for rendering 2D and 3D graphics in a web browser.
- OpenGL ES: A graphics API for embedded systems, often used on mobile devices.
- Vulkan: A low-level graphics API that gives programs direct control over the GPU.
- Vertex: A point in 3D space that defines the corner of a shape.
- Vertex attribute: Data associated with each vertex, such as position, colour, or texture coordinates.
- Stride: The number of bytes between the start of one vertex and the start of the next.
- Offset: The number of bytes from the start of a vertex to a particular attribute.
- Alignment: The property of data starting at an address that is a multiple of its component size.
- Dirty range: A range of a buffer that has been modified and needs to be processed.
- Conversion buffer: A temporary buffer used to hold converted vertex data.
- IPC (Inter-Process Communication): A mechanism that allows different processes to exchange data and commands.
- Serialisation: The process of converting data structures into a format that can be transmitted or stored.
- Commit: A recorded change to a source code repository.
- Bisection: A method of finding the change that introduced a bug by testing versions between a known good and a known bad one.
- PoC (Proof of Concept): A demonstration that a vulnerability can be exploited.
- CVE: A unique identifier for a publicly known security vulnerability.
- Chrome VRP: Google's Vulnerability Reward Program for Chrome, which pays researchers for finding security bugs.