Insufficient validation of untrusted input in WebGL (CVE-2026-9880)
The GPU process's validating command buffer reads client-controlled shared memory twice when handling buffer updates, so a compromised renderer can change the data between the validation copy and the driver upload. This could let an attacker bypass index bounds checks and cause an out-of-bounds access in the GPU driver, potentially escaping the sandbox on Android.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 41 days
Flapjack, 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 go/chrome-ai-generated-security-bugs-faq for more information.
Overview: The GPU process's validating command buffer contains a double-fetch vulnerability when processing buffer updates like glBufferSubData. It reads from client-controlled shared memory twice: once to update a CPU-side shadow buffer used for validation, and again to send data to the GL driver. A compromised renderer can concurrently modify this shared memory to bypass index bounds validation, potentially causing an out-of-bounds access in the GPU hardware.
Affected files:
gpu/command_buffer/service/buffer_manager.ccgpu/command_buffer/service/gles2_cmd_decoder.cc
Estimated timestamp from git blame: 2025-11-28
Vulnerability Details
To prevent malicious WebGL content from causing out-of-bounds (OOB) memory accesses in the GPU driver, the validating command buffer maintains a CPU-side "shadow" copy of GL_ELEMENT_ARRAY_BUFFER (index buffer) data. During a glDrawElements call, the service scans this shadow buffer to find the maximum index accessed, ensuring it fits within the bounds of the currently bound vertex attributes.
However, several buffer update functions exhibit a time-of-check to time-of-use (TOCTOU) / double-fetch vulnerability when reading from shared memory. For example, in BufferManager::DoBufferSubData:
void BufferManager::DoBufferSubData(
Buffer* buffer, GLenum target, GLintptr offset, GLsizeiptr size,
const GLvoid* data) {
// FETCH 1: Copies data from shared memory `data` to the CPU shadow buffer
buffer->SetRange(offset, size, data);
if (!buffer->IsClientSideArray()) {
// FETCH 2: Driver reads directly from the shared memory `data` to GPU memory
glBufferSubData(target, offset, size, data);
}
}
The data pointer originates from a transfer buffer (base::UnsafeSharedMemoryRegion) mapped by both the renderer and the GPU process. Because there are no cross-process locks, the renderer can modify the memory between SetRange and glBufferSubData. Similar vulnerable patterns exist in GLES2DecoderImpl::DoFlushMappedBufferRange and GLES2DecoderImpl::UnmapBufferHelper.
Potential Exploitation Steps
(Note: These are suggested/potential steps, as our tooling agent does not have the ability to run code or verify a live Proof of Concept.)
- Renderer Compromise: An attacker gains code execution in a sandboxed renderer process.
- Setup: The attacker initializes a WebGL context, creating a small vertex buffer and an element array buffer.
- Race Preparation: The attacker maps a shared memory transfer buffer and issues a
BufferSubDatacommand pointing to it. - Concurrent Modification: A worker thread in the renderer rapidly alternates the contents of the shared memory between "safe" indices (within vertex buffer bounds) and "malicious" indices (large, out-of-bounds values).
- Winning the Race: If the GPU process executes
buffer->SetRangewhile the memory contains safe indices, the shadow buffer is populated safely. Microseconds later, the renderer thread overwrites the shared memory with malicious indices. The GPU process then executesglBufferSubData, uploading the malicious indices to GPU VRAM. - Triggering the OOB: The attacker issues a
glDrawElementscommand. The GPU service validates the draw call using the safe indices in the shadow buffer, allowing the call to proceed. The underlying GPU hardware executes the draw using the malicious VRAM buffer, resulting in an OOB memory access.
Because the validating command decoder is the default on Android, and the GPU process is unsandboxed on that platform, an OOB access in the GPU driver can potentially lead to a full sandbox escape.
Suggested Fix
Do not pass the raw shared memory pointer to the underlying GL driver if the buffer is shadowed. Instead, copy the data once into service-side memory (which the SetRange call already does by populating shadow_), and pass the safe, service-side pointer to the GL driver.
For example, in BufferManager::DoBufferSubData:
buffer->SetRange(offset, size, data);
if (!buffer->IsClientSideArray()) {
// Pass the pointer from the shadow buffer, not the shared memory
glBufferSubData(target, offset, size, buffer->GetRange(offset, size));
}
Similar refactoring should be applied to DoFlushMappedBufferRange and UnmapBufferHelper to ensure that data written to the GPU strictly matches the data validated in the shadow buffer.
Evaluated with Chrome root at commit: c0eb5541aebfa4ea08806eaf6e94bcc69f87ab2f
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
The code passes the raw shared memory pointer to the GL driver after validating a separate shadow copy, creating a time-of-check to time-of-use gap with no locking.
Impact
An out-of-bounds access in the GPU driver could lead to a full sandbox escape on Android, where the GPU process is unsandboxed, though the report notes the steps are unverified.
What the attacker needed
Code execution in a renderer process; ability to win a timing race; Android for sandbox escape impact
The fix
The data should be copied once into service-side memory and the safe shadow pointer passed to the GL driver instead of the shared memory pointer, with the same change applied to the other affected functions.
How it was found
- Gain code execution in a sandboxed renderer process.
- Create a WebGL context with a small vertex buffer and an element array buffer.
- Map a shared memory transfer buffer and issue a BufferSubData command pointing to it.
- Use a worker thread to rapidly alternate the shared memory between safe and out-of-bounds indices.
- Time the race so validation reads safe indices and the driver upload reads malicious ones.
- Issue a draw call that passes validation but uses the malicious buffer, causing an out-of-bounds access.
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.
Programs often copy data from one place to another in two steps: first to check it, then to use it. If an attacker can change the data between those two steps, the check sees one thing and the program uses another. Here a renderer process could swap safe numbers for dangerous ones in shared memory, so the GPU driver ends up reading memory it should not.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.