Insufficient validation of untrusted input in ANGLE (CVE-2026-13780)
ANGLE's draw-call validation does not check whether buffers bound as uniform or shader storage buffers are currently mapped, unlike vertex and index buffers. A compromised renderer could use a mapped buffer in a draw call, potentially causing memory corruption in the GPU process on backends such as Vulkan.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 43 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: ANGLE's draw call validation fails to verify that buffers bound as Uniform Buffer Objects (UBOs) or Shader Storage Buffer Objects (SSBOs) are not currently mapped. This oversight violates OpenGL ES invariants and, when combined with Chrome's passthrough command decoder, allows a compromised renderer to potentially trigger memory corruption in the GPU process.
Affected files:
third_party/angle/src/libANGLE/validationES.cppgpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
Estimated timestamp from git blame: 2017-11-03
Summary
A potential validation gap exists in ANGLE where draw and dispatch call validation fails to ensure that bound uniform and shader storage buffers are not currently mapped. While ANGLE performs these checks for vertex and index buffers, it omits them for indexed buffer bindings. This allows a compromised renderer to use mapped buffers during drawing operations, leading to backend-specific undefined behavior or memory corruption.
Technical Details
The OpenGL ES specification prohibits the use of a buffer in a draw call if it is currently mapped. ANGLE enforces this for most buffer targets, but has a notable gap for UBOs and SSBOs:
- Incomplete Validation: In
third_party/angle/src/libANGLE/validationES.cpp, theValidateProgramDrawStatesfunction (lines 661-804) iterates through bound uniform blocks to validate their state (e.g., size requirements and transform feedback conflicts). However, it does not check if the bounduniformBufferis currently mapped. Furthermore, SSBO validation is entirely absent from this function. - Missing Global Checks: The
ValidateDrawStatesfunction, which is the primary entry point for draw-time validation, checks for mapped vertex buffers viavertexArray->hasInvalidMappedArrayBuffer()(line 4054), but performs no equivalent check for indexed buffer bindings. - Command Decoder Interaction: In WebGL2 contexts, ANGLE might assume that buffer mapping is restricted. However, Chrome's passthrough command decoder explicitly exposes
cmds::MapBufferRangeto WebGL2 contexts ingpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc(line 1364). This allows a compromised renderer to map a buffer and subsequently use it in a draw call, bypassing the intended safety invariants.
Impact
Violating the mapping invariant can lead to serious memory safety issues in the GPU backend. For example, in the D3D11 backend (Buffer11.cpp), using a mapped buffer as a UBO could previously lead to a Use-After-Free (UAF) if the underlying storage was evicted from the internal range cache while still mapped (tracked in anglebug.com/505771894). While a partial mitigation exists in the D3D11 backend to return an error, the Vulkan backend lacks equivalent safeguards and could experience memory corruption or race conditions if the GPU reads from memory that the CPU is concurrently modifying.
Potential Reproduction Steps
Note: These steps are based on static analysis and have not been verified with a running proof-of-concept.
From a compromised renderer with a WebGL2 context using the passthrough decoder:
- Create a GL buffer and populate it with data.
- Bind the buffer as a uniform buffer:
glBindBufferBase(GL_UNIFORM_BUFFER, 0, buf);. - Map the buffer via the command buffer:
gl.mapBufferRange(gl.UNIFORM_BUFFER, ...);. - Execute a draw call:
gl.drawArrays(...);. - Observe that the draw call passes ANGLE validation despite the UBO being mapped.
Suggested Fix
Update ValidateProgramDrawStates in third_party/angle/src/libANGLE/validationES.cpp to iterate through all active uniform blocks and shader storage blocks in the program executable. For each bound buffer, verify its mapping state by calling isMapped(). If any buffer is mapped and lacks the GL_MAP_PERSISTENT_BIT_EXT access flag, return a kBufferMapped error.
Evaluated with Chrome root at commit: 29093e11cf509e3593f6229e4b1b075cca356049
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 the draw-time validation in ANGLE checks mapped state only for vertex and index buffers, omitting uniform and shader storage buffer bindings.
Impact
On the Vulkan backend this could lead to memory corruption or race conditions, while the D3D11 backend has only a partial mitigation that returns an error.
What the attacker needed
Compromised renderer; WebGL2 context; passthrough command decoder
The fix
Validation should iterate over active uniform and shader storage blocks and reject any bound buffer that is mapped without the persistent mapping flag.
How it was found
- Create a GL buffer and fill it with data.
- Bind the buffer as a uniform buffer.
- Map the buffer through the command buffer.
- Issue a draw call.
- Observe that the draw call passes validation even though the buffer is mapped.
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.
A graphics driver must not read from a buffer while the program is still writing to it, because the two sides could disagree about the contents. ANGLE, the layer Chrome uses to talk to the GPU, checks this rule for some buffer types but forgets to check it for two others. If an attacker has already broken out of the web page sandbox, they could exploit that gap to confuse the GPU process.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.