Insufficient validation of untrusted input in Skia (CVE-2026-11675)
Skia's SDF-LCD text rendering does not clamp subpixel offsets to the glyph's atlas rectangle, so a compromised renderer can deserialize a forged Slug with an excessively large creation matrix and cause the GPU shader to sample adjacent glyph data from the shared atlas. This could leak cross-origin text pixels into an attacker-controlled raster tile.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 13 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 potential out-of-bounds texture read vulnerability exists in Skia's SDF-LCD text rendering backends (both Ganesh and Graphite). In Release builds, a compromised renderer can deserialize a forged sktext::gpu::Slug containing an excessively scaled creation matrix. This forces the GPU shader to compute an inflated subpixel offset that is not clamped, resulting in sampling outside the active glyph's bounds and potentially leaking cross-origin adjacent glyph data from the shared atlas.
Affected files:
third_party/skia/src/gpu/ganesh/effects/GrAtlasedShaderHelpers.hthird_party/skia/src/gpu/ganesh/effects/GrDistanceFieldGeoProc.cppthird_party/skia/src/gpu/ganesh/ops/AtlasTextOp.cppthird_party/skia/src/gpu/graphite/render/SDFTextLCDRenderStep.cppthird_party/skia/src/sksl/sksl_graphite_frag.sksl
Estimated timestamp from git blame: 2024-06-06
Description and Root Cause
In both the Ganesh and Graphite backends of Skia, SDF-LCD text rendering calculates dynamic subpixel offsets to sample neighboring positions (for the red, green, and blue subpixel channels) on the shared kA8 glyph atlas. These offsets scale with the spatial derivative of the texture coordinates (representing the minification ratio).
However, these dynamically computed offsets are never clamped to the glyph's assigned atlas rectangle during fragment shading. In third_party/skia/src/gpu/ganesh/effects/GrAtlasedShaderHelpers.h (lines 129-138), the adjusted texture coordinates are computed as follows:
half2 uv_adjusted = half2(coord) - offset;
distance.x = texture(atlas, uv_adjusted).r;
Similarly, in Graphite's fragment shader third_party/skia/src/sksl/sksl_graphite_frag.sksl under $sample_indexed_atlas_lcd (lines 1394-1396):
distance.x = sample(atlas1, textureCoords - offset).r;
Because the SDF-LCD path assumes that the standard 2-texel inset padding (SK_DistanceFieldInset = 2) is always sufficient to absorb subpixel filtering shifts, it does not apply bounds clamping in the shader. However, a compromised renderer can bypass normal Blink-side layout validation and deserialize a forged sktext::gpu::Slug containing an arbitrary, extremely large scale factor in its fCreationMatrix (e.g., Scale(k, k) where k >= 12).
In third_party/skia/src/text/gpu/VertexFiller.cpp (lines 60-61), the creationMatrix is read directly from the untrusted deserialization buffer with no scale checks:
SkMatrix creationMatrix;
buffer.readMatrix(&creationMatrix);
In Release builds, the safety assert in Ganesh's Device::drawSlug (valid_slug_matrices in third_party/skia/src/gpu/ganesh/Device.cpp:1404-1425) compiles out, and Graphite has no such verification code. As a result, when this mismatched slug is drawn, VertexFiller::boundsAndDeviceMatrix calculates a relative matrix difference (viewDifference = positionMatrix * creationMatrix^-1), which scales down the physical screen bounds of the quad by 1/k while keeping the texture coordinates unscaled.
In the fragment shader, the derivative of the texture coordinates scales up proportionally to k, producing an offset of k/3 texels. When k is sufficiently large (e.g., 12), the offset exceeds the 2-texel padding boundary, causing the shader to sample the texture data of adjacent glyphs belonging to other origins inside the globally shared kA8 atlas.
Note: We have analyzed this vulnerability statically through code inspection and do not yet have a working runtime proof of concept.
Potential Attack Scenario
- An attacker compromises the sandboxed Renderer process.
- The attacker craft a serialized IPC payload containing a
DrawSlugOpwith an excessively scaledcreationMatrix(e.g.,Scale(12, 12)) inside theVertexFillerparameters. - The attacker submits this payload via the OOP-R (Out-of-Process Rasterization) command buffer interface to the GPU process.
- The GPU process deserializes the malicious slug without throwing an error in Release builds.
- During rasterization, the fragment shader computes an inflated subpixel offset (e.g., 4 texels), sampling beyond the active glyph's boundary and retrieving adjacent glyph pixels from the shared atlas.
- The leaked cross-origin text pixels are blended into the attacker-controlled SharedImage raster tile, which the Renderer reads back via standard command buffer mailbox reads.
Suggested Fix
To remediate this issue, Skia should validate the matrix scale mismatch between the creation matrix and the drawing/position matrix at drawing time, even in production Release builds. Specifically, if the scaling ratio difference exceeds a safe threshold (e.g., a limit that ensures subpixel offsets cannot exceed SK_DistanceFieldInset), the draw call should be rejected or fallback to a safe rendering path.
Alternatively, enforce validation on the creationMatrix scale factor during the deserialization of VertexFiller in third_party/skia/src/text/gpu/VertexFiller.cpp.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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
Likely the SDF-LCD fragment shader computes subpixel sampling offsets from the texture-coordinate derivative without clamping them to the glyph's atlas rectangle, and the creation matrix read during Slug deserialization is not validated for scale in Release builds.
Impact
A compromised renderer could read adjacent glyph pixels from the shared atlas, potentially leaking cross-origin text data; the report notes this was analysed statically and no runtime proof of concept exists.
What the attacker needed
Compromised renderer process; Release build of Chrome
The fix
Skia should validate the scale mismatch between the creation matrix and the drawing matrix at draw time in Release builds, rejecting or falling back when the ratio would let subpixel offsets exceed the atlas inset, or validate the creationMatrix scale during VertexFiller deserialization.
How it was found
- Compromise the sandboxed renderer process.
- Craft a serialized IPC payload containing a DrawSlugOp with an excessively scaled creationMatrix inside the VertexFiller parameters.
- Submit the payload via the OOP-R command buffer interface to the GPU process.
- The GPU process deserializes the malicious slug without an error in Release builds.
- During rasterization the fragment shader computes an inflated subpixel offset and samples beyond the active glyph's boundary.
- The leaked cross-origin text pixels are blended into the attacker-controlled SharedImage raster tile, which the renderer reads back.
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 text is drawn on the GPU, Skia stores glyph images in a shared texture atlas. The shader normally samples a few pixels around each glyph to smooth edges, but it never checks that those samples stay inside the glyph's own rectangle. If an attacker who already controls the renderer process supplies a forged text object with a huge scale factor, the shader samples too far and picks up pixels from neighbouring glyphs, which may belong to another website.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.