Uninitialized Use in Skia (CVE-2026-15766)
Skia's Ganesh Vulkan backend tracks stencil attachment initialisation with a single global flag, but a Vulkan clear only affects the task's render area, so a partial clear marks the whole attachment as initialised. A later task reusing the attachment can load stale VRAM into the stencil buffer and read it back through rendering.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 59 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logic error in Skia's Ganesh Vulkan backend allows uninitialized GPU memory to be loaded into the stencil buffer. By exploiting a granularity mismatch between Skia's initialization tracking and Vulkan's render area clears, an attacker can leak stale VRAM contents from the GPU process.
Affected files:
third_party/skia/src/gpu/ganesh/ops/OpsTask.cppthird_party/skia/src/gpu/ganesh/GrAttachment.hthird_party/skia/src/gpu/ganesh/vk/GrVkOpsRenderPass.cppthird_party/skia/src/gpu/ganesh/vk/GrVkCommandBuffer.cppthird_party/skia/src/gpu/ganesh/vk/GrVkRenderPass.cppthird_party/skia/src/gpu/ganesh/vk/GrVkImage.cppthird_party/skia/src/gpu/ganesh/GrResourceProvider.cppthird_party/skia/src/gpu/ganesh/SurfaceDrawContext.cpp
Estimated timestamp from git blame: 2019-10-01
Summary
A potential vulnerability exists in Skia's Ganesh Vulkan backend where the mechanism for tracking the initialization of stencil attachments does not account for the specific render area of the clear operation. This can result in a shared stencil attachment being marked as 'cleared' even if only a small sub-rectangle was actually initialized. Subsequent tasks reusing the attachment may skip the necessary clear and instead load uninitialized GPU memory (stale VRAM), which can then be exfiltrated using standard rendering operations.
Technical Analysis
In third_party/skia/src/gpu/ganesh/ops/OpsTask.cpp, Skia tracks whether a stencil attachment has been initialized via a global flag: GrAttachment::fHasPerformedInitialClear. When a task requires stencil bits to be cleared, it checks this flag. If it is false, Skia sets the load operation to kClear and marks the flag as true after execution.
However, in the Vulkan backend, VK_ATTACHMENT_LOAD_OP_CLEAR is strictly limited to the renderArea specified in the VkRenderPassBeginInfo. Skia uses the task's fClippedContentBounds as this render area. If the task's bounds are smaller than the full attachment (e.g., a path confined to a corner), only that sub-rectangle is cleared to zero. The rest of the attachment remains uninitialized.
Because GrDirectContext and its GrResourceCache are shared across different renderer processes in the GPU process for OOP-R (Out-of-Process Rasterization), a stencil attachment created by one origin can be recycled and reused by another. If a second task (potentially from a different origin) reuses this attachment, it will observe fHasPerformedInitialClear == true and skip the initial clear, instead performing a VK_ATTACHMENT_LOAD_OP_LOAD. This loads the uninitialized/stale VRAM into the active stencil buffer.
An attacker can visualize this stale data by using the 'stencil-then-cover' rendering path. The 'cover' pass can be configured to write a specific color wherever the stencil value is non-zero (GrUserStencilTest::kNotEqual 0). By drawing a full-screen path, the resulting color buffer will reflect the state of the uninitialized VRAM, which can then be read back via getImageData().
Potential Reproduction Steps
- Use a configuration with Ganesh-Vulkan enabled (e.g., Chrome on Android or Linux with
--use-vulkan). - Canvas A: Create a 1024x1024 accelerated canvas. Draw a complex path confined to the top-left 10x10 pixels. This triggers an initial clear of the stencil attachment but only for the 10x10
renderArea, while setting the globalfHasPerformedInitialClearlatch to true. - Canvas B: Create a second 1024x1024 accelerated canvas (possibly in a different origin). This context may receive the same cached
GrAttachmentfrom the GPU process. - The Leak: Draw a complex path covering the full canvas. Skia will skip the stencil clear because the latch is set, loading the stale VRAM from the previous attachment state.
- Exfiltration: Use
getImageData()on Canvas B to capture the pixels. Areas where the stale stencil data was non-zero will contain the draw color, revealing the VRAM contents.
Suggested Fix
Ensure that the fHasPerformedInitialClear flag is only set if the clear operation covers the full dimensions of the GrAttachment. If a partial clear is performed, the flag should remain false, or Skia should track the initialized region more granularly (e.g., using a dirty rect approach).
Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a
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
The initialisation flag is global to the attachment, while the Vulkan clear only covers the task's clipped render area, so a partial clear is treated as a full clear.
Impact
An attacker could leak stale VRAM contents from the GPU process, potentially across origins, though the report is a potential issue and does not demonstrate a working exploit.
What the attacker needed
Ganesh-Vulkan backend enabled; GPU process shares resource cache across origins; Attacker can draw paths and read pixels
The fix
The flag should only be set when the clear covers the full attachment, or Skia should track the initialised region more granularly.
How it was found
- Run a build with Ganesh-Vulkan enabled, such as Chrome on Android or Linux with the Vulkan flag.
- On one accelerated canvas, draw a complex path confined to a small corner so only that sub-rectangle is cleared but the global flag is set.
- Create a second accelerated canvas, possibly from another origin, that may receive the same cached attachment.
- Draw a full-canvas complex path so Skia skips the clear and loads stale VRAM.
- Read the pixels back with getImageData to observe the leaked stencil state.
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.
A graphics library keeps a note saying 'this stencil buffer has been cleared'. But the clear only wiped a small rectangle, not the whole buffer. A later drawing operation trusts the note, skips clearing, and reads leftover GPU memory that may belong to another page or process.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.