Buffer overflow in ANGLE (CVE-2026-87654)
The report describes a potential heap out-of-bounds write in ANGLE's D3D11 backend, caused by an unchecked 32-bit addition in reserveSpace and a stale mReservedSpace value left behind when an attribute reservation fails with GL_INVALID_OPERATION. An attacker could theoretically wrap the size check, skip the buffer discard, and have attacker-controlled vertex data copied past the end of a mapped D3D11 buffer in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 days
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential host heap out-of-bounds write vulnerability exists in the ANGLE D3D11 backend due to an unchecked 32-bit unsigned addition and a stale state variable (mReservedSpace) across an early error return. An attacker can theoretically poison the reserved space to intentionally wrap a size check, allowing arbitrary vertex data to be copied past the dynamically mapped D3D11 buffer. This results in a potential linear heap OOB write in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/d3d/VertexBuffer.cppthird_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cppthird_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp
Estimated timestamp from git blame: 2019-03-23
1. Summary of the Issue (Meant for Human Triage)
A potential heap out-of-bounds (OOB) write vulnerability exists in the GPU process via ANGLE's D3D11 backend on Windows. The issue stems from two coupled defects in StreamingVertexBufferInterface that allow a WebGL attacker to bypass buffer discard logic and write arbitrary, format-converted vertex data linearly past the end of a mapped D3D11 dynamic buffer.
First, StreamingVertexBufferInterface::reserveSpace utilizes an unchecked 32-bit unsigned addition (mWritePosition + size > curBufferSize) that is susceptible to integer wrapping. Second, the mReservedSpace state variable accumulates requested sizes during the per-attribute vertex space reservation loop. If a subsequent attribute fails validation in the backend (e.g., throwing a GL_INVALID_OPERATION due to an insufficient source buffer size), the reserve loop early-returns. Crucially, GL_INVALID_OPERATION does not cause context loss (unlike GL_OUT_OF_MEMORY), but the early return skips the cleanup path in storeDynamicAttribute, leaving mReservedSpace poisoned with a massive stale value.
By carefully sequencing draw calls, an attacker can intentionally wrap the unchecked addition in reserveSpace, bypass the buffer discard/reallocation operation, and trick VertexBuffer11::storeVertexAttributes into mapping the D3D11 buffer and copying vertex data completely out-of-bounds. Because the only size validation at the copy sink is a debug-only ASSERT, the write occurs silently in release builds. This grants a potential A-SERVER reachable sandbox escape primitive on Windows.
Note: The following are suggested/potential steps and analysis, as our tooling agent does not yet have the ability to run code to produce a live proof-of-concept.
2. Proof-of-Concept & Detailed Execution Flow
Potential Attacker Steps & Execution Trace
Step 1: Frontend Validation Bypass (Design)
On the D3D11 backend, ANGLE advertises robust buffer access support (renderer11_utils.cpp:1318). This causes the frontend to disable its own buffer bounds validation (Context.cpp:4825, validationES.h:851-854). Mismatched buffer bounds therefore successfully reach the backend.
Step 2: Buffer Growth and Write Position Setup (Draw 1)
The attacker creates a large gl.DYNAMIC_DRAW buffer (600 MB) bound to attribute 0 with format gl.INT_2_10_10_10_REV. This format requires CPU conversion to DXGI_FORMAT_R32G32B32A32_FLOAT (4 bytes to 16 bytes per vertex).
- The attacker issues a draw call for 150,000,000 points.
- The required space is 150M * 16 = 2.4 GB.
reserveSpacecreates a 2.4 GB dynamic D3D11 buffer.mWritePositionis advanced to 2.4 GB, andmReservedSpaceis set to 0 (VertexBuffer.cpp:152-163).
Step 3: Poisoning mReservedSpace (Draw 2)
The attacker uses a program with two active dynamic attributes. Attribute 0 has a 500 MB source buffer. Attribute 1 has a 100-byte source buffer.
-
The attacker issues a draw call for 125,000,000 points.
-
Attribute 0: Requires 2.0 GB.
reserveVertexSpacecalculates 2.0 GB. InreserveSpace, the unchecked additionmWritePosition(2.4 GB) +size(2.0 GB) wraps around a 32-bit unsigned integer to approximately 105 MB. Since 105 MB is not greater than thecurBufferSize(2.4 GB), the buffer discard is bypassed (VertexBuffer.cpp:157).mReservedSpaceis updated to 2.0 GB. -
Attribute 1: The required size for 125M vertices far exceeds the 100-byte buffer. The check in
VertexDataManager::reserveSpaceForAttribfails:C++ // VertexDataManager.cpp:526 ANGLE_CHECK(GetImplAs<ContextD3D>(context), maxByte <= static_cast<int64_t>(bufferD3D->getSize()), gl::err::kInsufficientVertexBufferSize, GL_INVALID_OPERATION); -
This throws a
GL_INVALID_OPERATIONand aborts the reserve loop early (VertexDataManager.cpp:450-452). -
ErrorSet::handleErrorprocesses the error but does not trigger context loss (which only occurs onGL_OUT_OF_MEMORY). -
Because the reserve loop aborted, the store loop is skipped,
storeDynamicAttributeis never executed, andmReservedSpaceis never reset to 0. It remains poisoned at 2.0 GB.
Step 4: The Out-of-Bounds Write (Draw 3) The attacker issues a draw call with a single attribute pointing to a 25 MB payload buffer for 6,250,000 points (requiring 100 MB of space).
-
reserveVertexSpaceadds the stalemReservedSpaceto the requested size:alignedRequiredSpace += mReservedSpace(100 MB + 2.0 GB = 2.1 GB) (VertexBuffer.cpp:225). -
reserveSpaceis invoked withsize = 2.1 GB. -
The unchecked addition overflows again:
mWritePosition(2.4 GB) +size(2.1 GB) = 4.5 GB, which wraps to approximately 205 MB.C++ // VertexBuffer.cpp:157 else if (mWritePosition + size > curBufferSize) { // Wraps, evaluates to false ANGLE_TRY(discard(context)); mWritePosition = 0; } -
The discard is bypassed.
mWritePositionremains at 2.4 GB. -
storeDynamicAttributechecks the actual space required (100 MB):2.4 GB + 100 MB = 2.5 GB. This fits safely inside a 32-bit unsigned integer, passing theCheckedNumericoverflow validation (VertexBuffer.cpp:184-186). -
VertexBuffer11::storeVertexAttributesis called withoffset = 2.4 GB. -
The D3D11 resource is mapped. The
outputpointer is calculated asmMappedResourceData + offset. Sinceoffsetexactly equals the mapped buffer size,outputpoints to the first byte out-of-bounds. -
The only bounds check is an
ASSERT:C++ // VertexBuffer11.cpp:146 ASSERT(checkedSpaceRequired.IsValid() && checkedSpaceRequired.ValueOrDie() <= mBufferSize); -
In release builds, this is stripped.
vertexFormatInfo.copyFunctionexecutes, linearly copying 100 MB of attacker-supplied bytes directly into the GPU process host heap.
Suggested Fix
- Use Checked Math in
reserveSpace: The calculationmWritePosition + sizeinStreamingVertexBufferInterface::reserveSpacemust be performed usingangle::CheckedNumeric<unsigned int>. If it overflows, it should trigger a discard or return an error. - Ensure State Consistency:
mReservedSpaceshould be reset to0either at the start ofVertexDataManager::reserveSpaceor guaranteed to be cleaned up in afinally-style pattern if the attribute loop aborts with an error.
3. Technical Verification Details (Automated Audit Logs)
Reviewers may skip this section. It contains automated audit ledgers for triage verification.
Verbatim Critic Validation Verdict:
Severity: High (S1)
Brief Notes / Reasoning: The vulnerability is a valid, A-SERVER reachable heap out-of-bounds write in the GPU process (ANGLE D3D11 backend). I have verified the code paths and the integer overflow mechanism:
- In
StreamingVertexBufferInterface::reserveSpace(VertexBuffer.cpp:157),mWritePosition + size > curBufferSizeperforms an unchecked 32-bit unsigned addition.- An attacker can inflate
sizeusing a stalemReservedSpace. By submitting a draw call with two dynamic attributes where the first succeeds inreserveSpaceForAttrib(settingmReservedSpace), but the second fails atVertexDataManager.cpp:529, aGL_INVALID_OPERATIONis returned.- Crucially,
GL_INVALID_OPERATIONdoes not cause context loss (onlyGL_OUT_OF_MEMORYdoes), and the reserve loop early-returns. The store loop is skipped, meaningmReservedSpace = 0(VertexBuffer.cpp:188) is never reached.- On the next draw call,
reserveVertexSpaceadds the stalemReservedSpace(e.g. 2.0GB) to the newrequiredSpace. This inflatedsizecausesmWritePosition + sizeto wrap around 32-bits (e.g., 2.4GB + 2.1GB = 4.5GB -> 205MB), bypassing the> curBufferSizecheck.- The discard is skipped, and
VertexBuffer11::storeVertexAttributesperforms the copy. The only bounds check (checkedSpaceRequired <= mBufferSize) is a debug-onlyASSERT(VertexBuffer11.cpp:148). Thus, attacker-controlled vertex data is written linearly out of bounds of the mapped D3D11 buffer (mMappedResourceData).Severity Assessment: High (S1)
- The GPU process is unsandboxed on Android (which would make this Critical), but this vulnerability affects the D3D11 backend, which is Windows-only.
- On Windows, the GPU process is sandboxed. A web-content (A-SERVER) attacker achieving memory corruption in the sandboxed GPU process is equivalent to a Sandbox Escape or compromised renderer, which is High (S1).
- The high RAM precondition (~2.4GB buffer) does not downgrade severity per the threat model.
- MiraclePtr does not apply as this is a linear heap buffer overflow, not a UAF.
Environmental Assumptions & Validation
- Platform/OS: Windows (where the default backend for ANGLE is D3D11). The issue is compiled out on Android because the D3D11 backend is excluded at build-time.
- D3D11 Resource Size Support: Success of allocating a dynamic buffer of size ~2.4 GB depends on the underlying driver supporting large resources (lifted in D3D11.1 and WDDM 2.0) and sufficient system/VRAM resources. Per the security guidelines, high-RAM requirements do not mitigate severity.
- Math Verification: 32-bit unsigned wrapping limits verified.
- 2.4 GB (2,566,914,048 bytes) + 2.0 GB (2,147,483,648 bytes) = 4,714,397,696 bytes. Wrapped modulo 2^32 = 419,430,400 bytes (~400 MiB), successfully bypassing
> 2,400,000,000discard check.
- 2.4 GB (2,566,914,048 bytes) + 2.0 GB (2,147,483,648 bytes) = 4,714,397,696 bytes. Wrapped modulo 2^32 = 419,430,400 bytes (~400 MiB), successfully bypassing
- No Mitigations Intercepting the Flow: The CheckedNumeric variables used in
storeDynamicAttributeandreserveVertexSpaceonly validate against absolute 32-bit integer overflow (checking if the value exceeds 2^32-1). They do not validate against the actual size of the vertex buffer. Frontend validation is skipped precisely becauserobustBufferAccessBehaviorKHRevaluates to true on the D3D11 backend.
Evaluated with Chrome root at commit: b96d2ec58f4f5f92b540a723966b199d6e9951b4
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an unchecked 32-bit unsigned addition in reserveSpace combined with a stale mReservedSpace value that is not reset when the per-attribute reservation loop aborts early on a non-fatal GL_INVALID_OPERATION error.
Impact
A web attacker could potentially achieve memory corruption in the sandboxed Windows GPU process, which the report treats as a high-severity primitive; the exploit depends on the driver supporting a very large dynamic buffer and on ample memory, and the report provides no live proof-of-concept.
What the attacker needed
Windows with D3D11 backend; Driver supports ~2.4 GB dynamic buffer; Large system/VRAM memory available; Attacker can run WebGL content
The fix
The addition in reserveSpace should use checked arithmetic and trigger a discard or error on overflow, and the reserved-space value should be reset at the start of the reservation routine or cleaned up when the attribute loop aborts.
How it was found
- Create a large dynamic vertex buffer with a format that needs CPU conversion, and draw enough points to grow the buffer and advance the write position.
- Issue a draw with two dynamic attributes where the first reserves a large amount of space and the second fails validation because its source buffer is too small.
- Observe that the error does not cause context loss and the reservation loop returns early, leaving the reserved-space value stale.
- Issue a further draw so the stale value inflates the requested size, wrapping the addition and bypassing the discard.
- The copy then proceeds from an offset at the end of the mapped buffer, writing past it because the only check is a debug assertion.
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.
Web pages can draw 3D graphics through a browser component called ANGLE, which on Windows talks to the graphics driver via a Microsoft interface called D3D11. The report claims a maths mistake lets a crafted page make the browser copy more data into a graphics buffer than the buffer can hold, corrupting memory in the process that handles graphics. The authors say they have not actually run an exploit, so this is an analysis rather than a demonstrated attack.
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.