Out of bounds read in Skia (CVE-2026-17745)
Skia Ganesh's TextureOp batches up to 512 quads but perspective clipping can split quads, inflating the count to 1024 while the shared index buffer only holds 512 quads. A compromised renderer could use this to make the GPU read out-of-bounds indices and rasterise leaked GPU memory into a readable SharedImage.
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 security team.
Overview: Skia Ganesh's TextureOp batches up to 512 input quads, but perspective clipping can split these quads, inflating the total count to 1024. Because the operation uses a shared, fixed-size index buffer provisioned for only 512 quads, the GPU is instructed to read indices out-of-bounds. A compromised renderer can potentially exploit this via the RasterInterface to rasterize and exfiltrate out-of-bounds GPU memory into a readable SharedImage.
Affected files:
third_party/skia/src/gpu/ganesh/ops/TextureOp.cppthird_party/skia/src/gpu/ganesh/ops/QuadPerEdgeAA.cppthird_party/skia/src/gpu/ganesh/GrOpsRenderPass.cppcomponents/viz/service/display/skia_renderer.cc
Estimated timestamp from git blame: 2021-06-02
Summary
There is a potential Out-of-Bounds (OOB) memory read vulnerability in the GPU process caused by Skia Ganesh's handling of perspective-clipped quads. When rendering large tiled images, TextureOp limits the number of input quads to match the capacity of a shared index buffer. However, it fails to account for quad count inflation caused by perspective clipping, leading to a draw call that reads past the end of the index buffer.
Root Cause Analysis
In third_party/skia/src/gpu/ganesh/ops/TextureOp.cpp, the AddTextureSetOps function groups input quads into a TextureOpImpl. For Anti-Aliased (AA) quads, it restricts the maximum number of input quads per batch to GrResourceProvider::MaxNumAAQuads() (512).
During TextureOpImpl construction, appendQuad is called for each quad. This function invokes GrQuadUtils::ClipToW0 to perform perspective clipping. If a quad has exactly one vertex behind the W=0 camera plane, ClipToW0 splits the resulting pentagon into two distinct quads. This inflates the total quad count for the batch from 512 up to 1024.
The op later binds a shared index buffer retrieved via QuadPerEdgeAA::GetIndexBuffer(). This buffer (refAAQuadIndexBuffer()) is statically sized to hold exactly 15,360 indices (512 quads * 30 indices/quad).
Finally, QuadPerEdgeAA::IssueDraw dispatches the draw command using the inflated quad count (1024), calculating the required indices as quadCnt * 30 (30,720 indices). All safety SkASSERT checks are disabled in Release builds. The native graphics API is thus instructed to read 30,720 indices from a 15,360-index buffer, resulting in an out-of-bounds read on the GPU.
Suggested Exploit Path
Note: These are potential steps deduced through static analysis; our tooling agent does not currently have the capability to run code or provide a working Proof of Concept.
A compromised renderer process could theoretically trigger and exploit this issue to exfiltrate cross-origin GPU memory:
- Bypass High-Level Filters: High-level Canvas2D APIs strip perspective from matrices. To bypass this, the attacker manually constructs a
cc::PaintOpBuffer. - Inject Perspective Matrix: The attacker pushes a
cc::SetMatrixOpconfigured with a 3D perspectiveSkM44matrix designed to place exactly one vertex of upcoming quads behind theW=0plane. - Trigger Tiling: The attacker pushes a
cc::DrawImageRectOpreferencing an image larger than the GPU'smax_texture_size(e.g., 16384x16384). - Dispatch via RasterInterface: The renderer sends these ops via
RasterInterface::RasterCHROMIUM. - GPU Execution: In the GPU process, the
RasterDecoderplays back the ops into aSharedImage. The large image triggersSkTiledImageUtils::DrawImageRect, which tiles the image and routes into the vulnerableTextureOp::AddTextureSetOpsbatching logic. - Exfiltration: The GPU hardware reads out-of-bounds indices, causing it to fetch out-of-bounds vertices and rasterize garbage/leaked memory (which may include other origins' textures or internal handles) into the
SharedImage. The attacker then retrieves the leaked pixels usingRasterInterface::ReadPixels.
Suggested Fix
Modify TextureOp::AddTextureSetOps to account for the possibility of perspective quad inflation. Specifically:
- Limit the input batch size for perspective quads to
MaxNumAAQuads() / 2(256) since each quad can at most be split into two. - Alternatively, dynamically track the post-clipping quad count as quads are appended, and flush/calve off a new
TextureOpImplif appending a split quad would causefMetadata.fTotalQuadCountto exceedMaxNumAAQuads().
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.
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 batching logic limits the number of input quads to the index buffer capacity but does not account for quads being split into two during perspective clipping, so the draw call uses more indices than the buffer holds.
Impact
A compromised renderer could potentially exfiltrate out-of-bounds GPU memory, which may include other origins' textures or internal handles, into a readable SharedImage.
What the attacker needed
Compromised renderer process; ability to send custom RasterInterface commands
The fix
The batching logic should limit perspective quads to half the maximum or dynamically track the post-clipping quad count and start a new batch when it would exceed the limit.
How it was found
- Manually construct a cc::PaintOpBuffer to bypass Canvas2D perspective stripping.
- Push a cc::SetMatrixOp with a 3D perspective matrix that places one vertex behind the W=0 plane.
- Push a cc::DrawImageRectOp referencing an image larger than the GPU's max_texture_size.
- Send the ops via RasterInterface::RasterCHROMIUM.
- The GPU process plays back the ops, triggering tiling and the vulnerable TextureOp batching.
- The GPU reads out-of-bounds indices and rasterises leaked memory into a SharedImage, which the attacker reads with RasterInterface::ReadPixels.
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 batches drawing instructions into groups of 512 shapes, but a perspective effect can split one shape into two, making the group larger than the fixed-size list of indices that tells the GPU which points to draw. The GPU then reads past the end of that list, which could expose memory from other parts of the system. An attacker who already controls the renderer process could try to capture that leaked memory.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.