Out of bounds write in ANGLE (CVE-2026-14397)
ANGLE's OpenGL backend on macOS Intel systems fails to validate a large 'first' parameter in glDrawArraysInstanced when only instanced attributes are enabled, leading to a massive buffer allocation failure and an unchecked null pointer in a memcpy. An attacker could write controlled data to an absolute memory address in the GPU process, potentially achieving remote code execution and sandbox escape.
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 without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: ANGLE's OpenGL backend on macOS Intel systems may allow a renderer-controlled absolute memory write in the GPU process. By passing an exceptionally large first parameter to glDrawArraysInstanced with only instanced attributes enabled, an attacker can bypass bounds validation, trigger a massive buffer allocation failure, and write controlled data to an absolute memory address via a missing nullptr check.
Affected files:
third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
Estimated timestamp from git blame: 2025-08-01
Description
A vulnerability exists in the ANGLE OpenGL backend's handling of instanced vertex attributes on macOS systems with Intel GPUs. When the shiftInstancedArrayDataWithOffset feature workaround is active, the code attempts to pad a dynamically allocated VBO based on the first parameter passed to glDrawArraysInstanced.
The code fails to properly validate the result of this massive memory allocation. In release builds, the ANGLE_GL_TRY macro drops underlying OpenGL errors. A subsequent call to MapBufferRangeWithFallback returns nullptr due to the lack of a backing store, but the pointer is used unchecked in a memcpy operation alongside an attacker-controlled offset, leading to an absolute memory write.
Potential Trigger Steps
Note: These are suggested steps based on static analysis. Our tooling has not yet executed a working proof of concept.
- Environment: The victim must be running Chrome on a macOS Intel device (excluding Haswell) where the OpenGL ANGLE backend is used (e.g., if Metal fails to initialize or via
--use-angle=gl). - Validation Bypass: A malicious WebGL2 site binds a Vertex Buffer Object containing attacker-controlled data and enables a single vertex attribute. The attacker calls
gl.vertexAttribDivisor(index, 1)to configure it strictly as an instanced attribute. - Draw Call: The attacker calls
gl.drawArraysInstanced(mode, first, count, instanceCount)with a heavily manipulatedfirstparameter close toINT32_MAX(e.g.,INT32_MAX - 1),count = 1, andinstanceCount = 1. - Bypassing Decoders & ANGLE Checks:
- Because only instanced attributes are active, the GPU process command decoder's bounds check (
VertexAttrib::MaxVertexAccessed) completely ignores thefirstparameter. - Similarly, ANGLE's
ValidateDrawAttribschecks the bounds againstcontext->getNonInstancedVertexElementLimit(). Because there are no non-instanced attributes, this limit remains atINT64_MAX, allowingfirst(up toINT32_MAX) to pass validation completely unchecked.
- Because only instanced attributes are active, the GPU process command decoder's bounds check (
- Workaround Trigger: The draw call triggers
VertexArrayGL::syncDrawState. Becausefirst > 0and the hardware-specific workaround is enabled, the code callsstreamAttributes(third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp:264). - Massive Allocation Failure:
streamAttributescalculatesrequiredBufferSize = streamingDataSize + (attribsToStream.count() * maxAttributeDataSize * first). WithfirstnearINT32_MAX, this requests a buffer up to ~34.3 GiB. The code callsANGLE_GL_TRYto allocate the buffer. In release builds,ANGLE_GL_TRYignores the resultingGL_OUT_OF_MEMORYerror. - Unchecked Mapping: The code calls
MapBufferRangeWithFallback, which returnsnullptrbecause the buffer allocation failed. - Absolute Write: The code calculates
curBufferOffset = maxAttributeDataSize * firstand executesmemcpy(bufferPointer + curBufferOffset, inputPointer + batchMemcpyInputOffset, destStride). SincebufferPointerisnullptr(0), this performs an absolute memory write of the attacker's VBO data to the attacker-controlledcurBufferOffset.
Impact
This vulnerability provides a highly reliable primitive to write attacker-controlled data to an arbitrary, absolute memory address within a massive ~34.3 GiB range in the unsandboxed GPU process. An attacker could use this to overwrite function pointers, vtables, or executable memory pages, leading to Remote Code Execution (RCE) and Sandbox Escape.
Suggested Fix
- Pointer Validation: Ensure
MapBufferRangeWithFallbackhandlesnullptrsecurely inVertexArrayGL::streamAttributes. Do not rely solely onASSERT(inputBufferPointer). Return aGL_OUT_OF_MEMORYerror if mapping fails. - Sanity Bounds on
first: The validating command decoder and ANGLE'sValidateDrawAttribsshould enforce a reasonable upper bound onfirsteven when only instanced attributes are active. The parameter should not be allowed to reach sizes that guarantee integer overflows or absurd memory allocation requests. - Review
ANGLE_GL_TRYusage: Investigate instances whereANGLE_GL_TRYis used for resource allocation (glBufferData) that subsequently map memory. Swallowing OOM errors on allocations that are immediately mapped is a dangerous pattern.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 the code fails to check the result of a buffer mapping operation (which returns null on allocation failure) before using the pointer in a memcpy, and also fails to bound the 'first' parameter when only instanced attributes are active.
Impact
This vulnerability could provide a reliable primitive to write attacker-controlled data to an arbitrary absolute memory address within a ~34.3 GiB range in the unsandboxed GPU process, potentially leading to remote code execution and sandbox escape.
What the attacker needed
Chrome on macOS Intel (excluding Haswell); OpenGL ANGLE backend used; Victim visits malicious WebGL2 site
The fix
The fix should validate the pointer returned by MapBufferRangeWithFallback, enforce a reasonable upper bound on the 'first' parameter even for instanced attributes, and review ANGLE_GL_TRY usage for resource allocations that are subsequently mapped.
How it was found
- Victim runs Chrome on a macOS Intel device where the OpenGL ANGLE backend is used.
- Attacker's WebGL2 site binds a Vertex Buffer Object with attacker-controlled data and enables a single instanced vertex attribute.
- Attacker calls gl.drawArraysInstanced with a very large 'first' parameter (e.g., near INT32_MAX), count=1, instanceCount=1.
- The large 'first' bypasses bounds checks because only instanced attributes are active.
- The draw call triggers a workaround that attempts to allocate a huge buffer, which fails, and the subsequent mapping returns null.
- The null pointer is used in a memcpy with an attacker-controlled offset, resulting in an absolute memory write.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report describes a bug in a graphics component called ANGLE, which helps web pages use the GPU. When a web page asks to draw many copies of a shape, it can pass a very large starting number that the software does not check properly. This causes the program to try to allocate a huge amount of memory, fail, and then write data to a memory address derived from that number, which could let an attacker run their own code on the computer.
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.