Skip to content
Info disclosure Advisory Advanced CVE-2026-9921

Uninitialized Use in WebGL (CVE-2026-9921)

A logic error in WebGL texture handling marks a texture as cleared before a copy operation succeeds. If the copy fails due to induced GPU out-of-memory, the texture remains uninitialized but is treated as safe to read, allowing an attacker to leak stale VRAM that may contain cross-origin data.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 51 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 security team.

Overview: GLES2DecoderImpl::DoCopyTexSubImage2D updates a texture's cleared state before ensuring the copy operation succeeds. If the copy fails (e.g., due to an induced GPU out-of-memory error), the texture remains uninitialized but is marked as cleared, allowing an attacker to read stale, potentially cross-origin VRAM.

Affected files:

  • gpu/command_buffer/service/gles2_cmd_decoder.cc
  • gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc

Estimated timestamp from git blame: 2016-10-12

Description

There is a logic error in GLES2DecoderImpl::DoCopyTexSubImage2D where the 'cleared' state of a destination texture is updated prematurely. The function updates the cleared_rect (via SetLevelCleared or SetLevelClearedRect) before performing the actual copy operation.

If the subsequent setup for the copy or the copy itself fails, the function exits early without rolling back the cleared state. Because WebGL contexts are created with lose_context_when_out_of_memory set to false, an attacker can survive an induced Out-Of-Memory (OOM) error and subsequently sample from the uninitialized texture, leading to a cross-origin leakage of GPU memory.

Potential Trigger Steps

  1. Initialize Context: The attacker creates a WebGL context. By default, lose_context_when_out_of_memory is false for WebGL contexts (gpu/ipc/common/gpu_channel.mojom), allowing the context to survive a GL_OUT_OF_MEMORY event.
  2. Induce Memory Pressure: The attacker aggressively allocates large WebGL textures to push the GPU driver close to its memory limit.
  3. Allocate Target Texture: The attacker calls gl.texImage2D(..., null) with a format like GL_LUMINANCE (which requires blit emulation on GLES3 devices). TextureManager::DoTexImage allocates VRAM but correctly leaves its cleared_rect empty, marking it uncleared.
  4. Execute Copy: The attacker calls gl.copyTexSubImage2D with dimensions that exactly cover the full size of the destination texture level.
  5. Premature State Change: In GLES2DecoderImpl::DoCopyTexSubImage2D, the code evaluates the bounds (destX == 0 && destY == 0 && src.width() == level_width && src.height() == level_height) and immediately executes texture_manager()->SetLevelCleared(..., true). The texture is now formally considered initialized and safe to read from.
  6. OOM Failure: Because GL_LUMINANCE requires a blit, the code calls InitializeCopyTexImageBlitter. Inside CopyTexImageResourceManager::Initialize, GL resource allocations (e.g., shaders, framebuffers) fail due to the induced memory pressure, triggering a GL_OUT_OF_MEMORY error.
  7. Early Exit: InitializeCopyTexImageBlitter detects the error via LOCAL_PEEK_GL_ERROR and returns false. DoCopyTexSubImage2D then immediately exits via an early return;.
  8. VRAM Leak: The actual copy is skipped. The texture remains physically uninitialized in VRAM but is tracked as cleared. The attacker binds the texture and reads its contents (e.g., via glReadPixels), successfully leaking cross-origin VRAM.

Suggested Fix

Defer the state updates to the Texture's cleared state until after the copy operation has been successfully executed. Specifically, move the calls to texture_manager()->SetLevelCleared and texture_manager()->SetLevelClearedRect to occur only after InitializeCopyTexImageBlitter (if applicable) and the subsequent copy commands (DoCopyTexSubImageToLUMACompatibilityTexture or glCopyTexSubImage2DFn) have completed without critical errors. This aligns the logic with GLES2DecoderImpl::DoCopyTexImage2D, which safely sets the cleared state only after verifying GL_NO_ERROR.

Evaluated with Chrome root at commit: f200f57a19490707ff8bc7aa5de3cbc443a3afad


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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 function updates the texture's cleared state before performing the copy, and does not roll back that state if the copy fails.

Impact

An attacker could leak stale VRAM that may contain cross-origin data, but the exploit requires inducing a GPU out-of-memory condition and the text does not demonstrate a working exploit.

What the attacker needed

WebGL support; ability to induce GPU out-of-memory; no user interaction required

The fix

The cleared state should be updated only after the copy operation succeeds, matching the logic in DoCopyTexImage2D.

How it was found

  1. Create a WebGL context that survives out-of-memory errors.
  2. Allocate many large textures to exhaust GPU memory.
  3. Allocate a target texture with a format that requires blit emulation.
  4. Call copyTexSubImage2D to cover the full destination texture.
  5. The copy setup fails with an out-of-memory error and the function exits early.
  6. Read back the texture contents to leak uninitialized VRAM.

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.

When a program creates a new texture in graphics memory, it should be empty or zeroed. This bug marks a texture as 'ready to use' before the copy that fills it actually happens. If that copy fails, the texture still contains old data from other programs, and the attacker can read it.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.