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

Uninitialized Use in Skia (CVE-2026-17757)

A logic flaw in Skia's Ganesh backend allows an OpsTask to attach and store uninitialized stencil buffer contents if a subsequent task enables stencil usage on a shared proxy. On tile-based Vulkan GPUs, this causes the task to write undefined tile memory residue back into the stencil buffer, which a subsequent task can read, leading to a potential cross-origin GPU memory leak observable via canvas readback.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 4 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 without the Chrome Security team.

Overview: A logic flaw in Skia's Ganesh backend allows an OpsTask to attach and store uninitialized stencil buffer contents if a subsequent task enables stencil usage on a shared proxy. On tile-based Vulkan GPUs, this causes the task to write undefined tile memory residue back into the stencil buffer. A subsequent task can then read this uninitialized data, leading to a potential cross-origin GPU memory leak observable via canvas readback.

Affected files:

  • third_party/skia/src/gpu/ganesh/ops/OpsTask.cpp
  • third_party/skia/src/gpu/ganesh/SurfaceDrawContext.cpp
  • third_party/skia/src/gpu/ganesh/ops/OpsTask.h
  • gpu/command_buffer/service/shared_context_state.cc

Estimated timestamp from git blame: 2021-05-03

Summary

There is a potential information disclosure vulnerability in Skia's Ganesh rendering backend. The issue stems from a synchronization failure between the GrRenderTargetProxy's stencil flag and the individual OpsTask initialization states. When a stencil-requiring operation is recorded, it retroactively enables the stencil flag for the entire proxy, causing previously recorded tasks to attach the stencil buffer without properly initializing it. On tile-based Vulkan GPUs (primarily Android), this results in uninitialized tile memory residue being written to main memory and subsequently read by the attacker.

Technical Details

By reviewing the Skia source code, the vulnerability unfolds through the following mechanism:

  1. Task 0 (T0) Creation: A basic draw operation (no stencil required) is recorded into OpsTask T0. Its fInitialStencilContent defaults to StencilContent::kDontCare. The canvas's SurfaceDrawContext currently has fNeedsStencil = false.
  2. Task Split: The task is split (e.g., due to an operation requiring a destination read). SurfaceDrawContext::willReplaceOpsTask is called. Because fNeedsStencil is false, it does not flag T0 to preserve the stencil (fMustPreserveStencil remains false).
  3. Task 1 (T1) Creation: A stencil-requiring operation is recorded into the new task T1. SurfaceDrawContext::setNeedsStencil() sets fNeedsStencil = true, updates T1's state to kUserBitsCleared, and crucially, sets needsStencil = true on the shared GrRenderTargetProxy.
  4. T0 Execution (The Leak): During flush, OpsTask::onExecute runs for T0. It sees proxy->needsStencil() == true and attaches the stencil buffer. Because its state is kDontCare, it sets the load op to GrLoadOp::kDiscard (mapping to VK_ATTACHMENT_LOAD_OP_DONT_CARE). However, caps.discardStencilValuesAfterRenderPass() is hardcoded to false in Skia (due to bug b/160958008), and fMustPreserveStencil is false, so the store op becomes GrStoreOp::kStore. On tile-based Vulkan GPUs, this combination writes uninitialized on-chip tile memory (containing residue from prior cross-origin GPU passes) back to the stencil attachment in main memory.
  5. T1 Execution (The Read): T1 executes with kUserBitsCleared. If the attachment was cleared in a previous flush, stencil->hasPerformedInitialClear() is true. The code falls through to GrLoadOp::kLoad, causing T1 to load the uninitialized data stored by T0. The leaked bits dictate clipping, which can be read out as pixel colors.

Note: Chrome's gpu/command_buffer/service/shared_context_state.cc disables fReduceOpsTaskSplitting, preserving task boundaries and preventing merge-time corrections of this state.

Potential Attacker Steps

Please note: These are suggested steps based on static code analysis. Our tooling agent does not yet have the ability to run code to produce a working Proof of Concept.

  1. Execute a WebGL or Canvas2D draw that requires a stencil, then force a flush (e.g., via getImageData()). This creates the stencil attachment and sets its sticky "cleared" bit to true.
  2. Draw a non-stencil primitive (creating T0).
  3. Execute an operation that forces a task split, such as drawing the canvas onto itself with a complex blend mode (triggering a destination read barrier).
  4. Draw a stencil-requiring primitive (creating T1).
  5. Force a flush by calling getImageData() and read the pixel values. The drawn pixels will reveal the leaked stencil residue bits from the uninitialized GPU tile memory.

Suggested Fix

There are two primary ways to address this state mismatch:

  • Fix in OpsTask Execution: In OpsTask::onExecute(), if fInitialStencilContent is kDontCare, the rendering pass should explicitly avoid storing the stencil buffer unless it was the task that actively requested it. Forcing stencilStoreOp = GrStoreOp::kDiscard for kDontCare tasks would prevent the uninitialized tile memory from being written back to the attachment.
  • Fix in Proxy State Propagation: Alternatively, when SurfaceDrawContext::setNeedsStencil() is called, it could iterate through all existing closed tasks that share the current GrRenderTargetProxy and update their fMustPreserveStencil or fInitialStencilContent states, rather than just updating the active OpsTask.

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 a synchronization failure between the shared render target proxy's stencil flag and individual OpsTask initialization states, causing a task that did not request stencil to store uninitialized stencil contents.

Impact

On tile-based Vulkan GPUs (primarily Android), this could lead to a cross-origin GPU memory leak observable via canvas readback, though the report is based on static analysis and no working exploit was demonstrated.

What the attacker needed

Tile-based Vulkan GPU (primarily Android); ability to run WebGL or Canvas2D; no working exploit demonstrated

The fix

The report suggests either forcing stencilStoreOp to discard for tasks with kDontCare initial stencil content, or updating all existing closed tasks when setNeedsStencil is called; it does not state that a fix was applied.

How it was found

  1. Execute a WebGL or Canvas2D draw that requires a stencil, then force a flush (e.g., via getImageData()) to create the stencil attachment and set its sticky 'cleared' bit to true.
  2. Draw a non-stencil primitive (creating T0).
  3. Execute an operation that forces a task split, such as drawing the canvas onto itself with a complex blend mode (triggering a destination read barrier).
  4. Draw a stencil-requiring primitive (creating T1).
  5. Force a flush by calling getImageData() and read the pixel values to reveal the leaked stencil residue bits.

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.

This report describes a bug in Skia, the graphics library used by Chrome, that could let a malicious website read leftover data from other websites through the GPU. The bug happens because a drawing task can accidentally save uninitialized memory from the GPU's stencil buffer, which is used for clipping, and then another task can read that memory and turn it into visible pixels. The report is based on code review, not a working exploit.

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.