Skip to content
Race condition Advisory Advanced CVE-2026-9929

Inappropriate implementation in WebGL (CVE-2026-9929)

A race condition during virtual WebGL context initialisation causes Chrome to skip pausing Transform Feedback, leaving the GPU driver's state out of sync with Chrome's tracking. An attacker could then capture cross-origin uniform and draw data from a victim's WebGL context, and potentially cause an out-of-bounds write in the GPU process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 48 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.

Overview: A race condition during virtual context initialization skips pausing Transform Feedback, causing Chrome's state tracking to desynchronize from the GPU driver. This allows an attacker's Transform Feedback session to remain active across context switches. Consequently, an attacker can capture sensitive cross-origin uniform and draw data from a victim's WebGL context.

Affected files:

  • ui/gl/gl_context.cc
  • gpu/command_buffer/service/context_state.cc
  • gpu/ipc/service/gles2_command_buffer_stub.cc
  • gpu/command_buffer/service/gles2_cmd_decoder.cc
  • gpu/command_buffer/service/gl_context_virtual.cc
  • gpu/command_buffer/service/gl_state_restorer_impl.cc
  • gpu/ipc/service/gpu_channel_manager.cc

Estimated timestamp from git blame: 2025-03-04

Description

On Android, Chrome uses the validating command decoder and virtualized GL contexts by default. All virtual contexts on a thread share the same underlying global gl::GLContext (the driver). When switching between virtual contexts, Chrome must pause and restore stateful operations like Transform Feedback (TF).

A vulnerability exists in how Chrome handles virtual context initialization. If an attacker context (Context A) leaves a Transform Feedback session active, and a new virtual context (Context C) is created, the following occurs:

  1. During Context C's creation, gl::GLContext::MakeVirtuallyCurrent is called before Context C's decoder is fully initialized.
  2. Because the decoder isn't initialized, virtual_context->GetGLStateRestorer()->IsInitialized() returns false, causing MakeVirtuallyCurrent to skip calling RestoreState.
  3. Crucially, despite skipping state restoration, MakeVirtuallyCurrent updates current_virtual_context_ = virtual_context (pointing to Context C).
  4. Shortly after, GLES2CommandBufferStub::Initialize forces a release, calling ForceReleaseVirtuallyCurrent(). This sets current_virtual_context_ to nullptr.
  5. When Context C is subsequently made current again, MakeVirtuallyCurrent attempts to restore state. However, because current_virtual_context_ is now nullptr, it passes a null prev_state to virtual_state->RestoreState(nullptr).
  6. Inside ContextState::RestoreProgramSettings, the code responsible for pausing the active TF session checks if prev_state is valid. Since it is null, the call to glPauseTransformFeedback() is skipped.

Impact

At this point, the underlying GL driver has Context A's TF active, but Chrome's internal state tracking (Context C) believes TF is inactive. This desynchronization persists across subsequent context switches.

When a victim context (Context B) in a cross-origin iframe or tab attempts to draw:

  1. Chrome switches to Context B. State restoration commands like glBindVertexArrayOES and glUseProgram are sent to the driver.
  2. Because TF is still active on the driver (from Context A), the OpenGL ES 3.0 specification dictates that these commands fail with GL_INVALID_OPERATION. Chrome silently ignores these errors during state restoration.
  3. The driver remains configured with Context A's VAO and Program.
  4. When Context B issues glUniform calls, the sensitive uniform data is written directly into Context A's program running on the driver.
  5. When Context B issues glDrawArrays, Chrome's validating decoder skips TF bounds checking (because it thinks TF is off for Context B). The driver executes the draw using Context A's program and active TF buffer, capturing the victim's data (processed using the leaked uniforms).
  6. If Context B's draw count exceeds Context A's TF buffer size, the lack of Chrome bounds checking may result in an out-of-bounds write within the GPU process driver, potentially leading to memory corruption.

Potential Trigger Steps

Note: These steps describe a potential attack path based on code analysis; a full proof-of-concept has not been executed.

  1. Attacker Context (Context A): Create a WebGL2 context. Compile a shader that captures varyings. Call gl.beginTransformFeedback() and gl.flush().
  2. Context C Creation: Immediately create a second WebGL2 context to trigger the initialization race condition, leaving Context A's TF active on the driver but disconnected from Chrome's tracking.
  3. Victim Context (Context B): A cross-origin WebGL context performs draw calls. Due to the driver state failures, its uniforms update Context A's program, and its draw output is captured by Context A's TF buffer.
  4. Exfiltration: The attacker switches back to Context A, calls gl.endTransformFeedback(), and uses gl.getBufferSubData() to read the cross-origin data.

Suggested Fix

In ui/gl/gl_context.cc, the MakeVirtuallyCurrent method should not update current_virtual_context_ if the state restorer is not yet initialized and state restoration is skipped.

C++
  if (switched_real_contexts || virtual_context != current_virtual_context_) {
    // ...
    if (virtual_context->GetGLStateRestorer()->IsInitialized()) {
        // ... perform restore ...
        current_virtual_context_ = virtual_context; // ONLY update if initialized
    } else {
        // Do not update current_virtual_context_ yet.
        // Ensure the real context is unbound or handled safely if necessary.
    }
  }

Alternatively, ContextState::RestoreProgramSettings may need a more robust way to ensure TF is paused on the real context when prev_state is null, rather than assuming it is already paused.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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

Likely, MakeVirtuallyCurrent updates the current virtual context pointer even when state restoration is skipped because the decoder is not yet initialised, so a later restore passes a null previous state and fails to pause Transform Feedback.

Impact

An attacker could capture sensitive cross-origin uniform and draw data from a victim's WebGL context, and if the victim's draw count exceeds the attacker's buffer size, the lack of bounds checking may cause an out-of-bounds write in the GPU process driver, potentially leading to memory corruption.

What the attacker needed

Android platform; Attacker controls a WebGL context; Victim visits attacker's page; Victim uses WebGL in cross-origin context

The fix

MakeVirtuallyCurrent should not update current_virtual_context_ when the state restorer is not yet initialised and state restoration is skipped, or RestoreProgramSettings should robustly ensure Transform Feedback is paused when prev_state is null.

How it was found

  1. Create a WebGL2 context, compile a shader that captures varyings, start Transform Feedback, and flush.
  2. Immediately create a second WebGL2 context to trigger the initialisation race condition.
  3. Have a cross-origin WebGL context perform draw calls, which write uniforms into the attacker's program and capture output in the attacker's Transform Feedback buffer.
  4. Switch back to the attacker context, end Transform Feedback, and read the captured data with getBufferSubData.

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 websites draw 3D graphics using the computer's graphics card. Chrome runs multiple WebGL contexts on the same graphics driver and must carefully switch between them. A bug in that switching lets one website's drawing session stay active while another website draws, so the first site can read data meant for the second.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.