Uninitialized Use in WebGL (CVE-2026-17808)
A logic flaw in the GLES2 command decoder causes the draw framebuffer to be rebound after draw buffers are prepared for clearing, so a clear can silently do nothing while the attachment is still marked as initialised. An attacker could then read back uninitialised GPU memory, potentially exposing graphics data from other origins.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
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 logic vulnerability exists in the GLES2 validating command decoder where the active draw framebuffer is rebound after preparing draw buffers for clearing. This discrepancy can allow a WebGL context to bypass lazy initialization of color attachments and read back uninitialized GPU memory contents.
Affected files:
gpu/command_buffer/service/gles2_cmd_decoder.ccgpu/command_buffer/service/framebuffer_manager.cc
Estimated timestamp from git blame: 2016-07-15
Description
In gpu/command_buffer/service/gles2_cmd_decoder.cc, the function GLES2DecoderImpl::ClearUnclearedAttachments handles the lazy clearing of framebuffers containing uninitialized attachments. When a framebuffer (fboA) is bound as GL_READ_FRAMEBUFFER and a different framebuffer (fboB) is bound as GL_DRAW_FRAMEBUFFER, the decoder must temporarily rebind fboA to the GL_DRAW_FRAMEBUFFER target to execute the glClear operation.
However, this rebinding is performed after the call to PrepareDrawBuffersForClearingUninitializedAttachments(). Consequently, the underlying driver-level call to glDrawBuffersARB is executed while fboB is still bound to the driver's GL_DRAW_FRAMEBUFFER target, instead of fboA. This results in two issues:
- The draw buffer state of
fboBis incorrectly modified/corrupted. - When
fboAis subsequently bound andglClearis executed, its active draw buffer state is still the client-defined state (which may be set toGL_NONEby the attacker). As a result, theglClearcall executes as a silent no-op.
Despite the clear operation failing to overwrite the uninitialized backing memory of the attachment, the decoder unconditionally marks the attachments of fboA as initialized via MarkAttachmentsAsCleared(). A subsequent read operation (such as glReadPixels) will then return uninitialized GPU memory contents back to the client.
Potential Trigger Path (Theoretical Analysis)
Note: Our tooling does not currently have the capability to run code, and the following steps represent a potential attack vector based on static code analysis.
- A WebGL2 page creates a renderbuffer (
rb) with an uninitialized backing store (e.g., usinggl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 256, 256)). - The page attaches
rbto a framebufferfboAatGL_COLOR_ATTACHMENT0. - The page configures
fboAto disable drawing to the color attachment by callinggl.drawBuffers([gl.NONE]). - The page binds a separate framebuffer
fboBtoGL_DRAW_FRAMEBUFFER, and bindsfboAtoGL_READ_FRAMEBUFFER. - The page triggers a read operation (e.g.,
gl.readPixels) fromfboA, forcing a lazy clear check. - During
ClearUnclearedAttachments, the driver-sideGL_DRAW_FRAMEBUFFERis not rebound tofboAearly because the renderbuffer format is not an integer format. PrepareDrawBuffersForClearingUninitializedAttachmentsruns, invokingglDrawBuffersARBwhich applies to the active draw FBO (fboB).fboAis bound toGL_DRAW_FRAMEBUFFER, andglClearis executed. Because its driver-side draw buffer is stillGL_NONE, no clear occurs onrb.rbis marked as cleared, and the uninitialized contents ofrbare read and returned to the attacker's buffer.
Impact
An attacker in a sandboxed WebGL context could exploit this vulnerability to read uninitialized GPU memory contents. In a shared GPU process environment, this could allow disclosure of sensitive cross-origin graphics data (such as canvas contents, textures, or video frames from other processes/tabs).
Suggested Remediation
To resolve this issue, the driver-side rebinding of the draw framebuffer should occur before evaluating or preparing the draw buffers for clearing.
Specifically, in GLES2DecoderImpl::ClearUnclearedAttachments, the rebinding logic should be consolidated and moved to the beginning of the function if target == GL_READ_FRAMEBUFFER and draw_framebuffer != framebuffer:
// Suggested Fix in gpu/command_buffer/service/gles2_cmd_decoder.cc
void GLES2DecoderImpl::ClearUnclearedAttachments(
GLenum target, Framebuffer* framebuffer) {
...
Framebuffer* draw_framebuffer = GetBoundDrawFramebuffer();
bool rebound_draw_framebuffer = false;
if (target == GL_READ_FRAMEBUFFER && draw_framebuffer != framebuffer) {
BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer->service_id());
rebound_draw_framebuffer = true;
}
...
This ensures that any subsequent draw buffer configuration or clear operation is executed against the correct target framebuffer.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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 framebuffer is rebound after preparing draw buffers for clearing, so the clear targets the wrong framebuffer and becomes a no-op while the attachment is still marked as cleared.
Impact
An attacker in a sandboxed WebGL context could read uninitialised GPU memory, potentially disclosing sensitive cross-origin graphics data such as canvas contents, textures, or video frames from other processes or tabs.
What the attacker needed
WebGL2 support in the browser; ability to run JavaScript in a page
The fix
The driver-side rebinding of the draw framebuffer should be moved before preparing draw buffers for clearing.
How it was found
- Create a renderbuffer with uninitialised storage and attach it to a framebuffer.
- Set the framebuffer's draw buffers to none.
- Bind a different framebuffer as the draw target and the first as the read target.
- Trigger a read from the first framebuffer to force a lazy clear check.
- The clear is skipped because the draw buffer state is still none, but the attachment is marked as cleared.
- Read pixels from the first framebuffer to obtain uninitialised memory.
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.
WebGL lets web pages draw and read pixels using the graphics card. Normally, new graphics memory is cleared before a page can read it, so one page cannot see another page's leftover data. Here, a mistake in the order of operations means the clear can be skipped, yet the system still believes the memory is clean, so a page could read whatever was left there.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.