Out of bounds read in Skia (CVE-2026-10985)
Skia's displacement map shader unpremultiplies its input without clamping, so a renderer that can supply invalid premultiplied colours can produce enormous displacement offsets. A compromised renderer could then sample uninitialised GPU scratch memory recycled from other origins and read it back through a canvas.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 17 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 compromised renderer can exploit Skia's displacement map implementation to leak cross-origin GPU scratch memory. By crafting 'super-luminescent' colors, an attacker can trigger a massive displacement that bypasses Skia's bounds checks, leading to the sampling of uninitialized GPU memory recycled from other contexts.
Affected files:
third_party/skia/src/sksl/sksl_rt_shader.skslthird_party/skia/src/effects/imagefilters/SkDisplacementMapImageFilter.cppthird_party/skia/src/core/SkImageFilterTypes.cppcc/paint/paint_op_reader.ccthird_party/skia/src/gpu/ganesh/image/SkSpecialImage_Ganesh.cppthird_party/skia/src/gpu/ganesh/GrSurfaceProxy.cpp
Estimated timestamp from git blame: 2023-06-09
Summary
A potential vulnerability in Skia's displacement map implementation (used in Chrome's GPU process for Out-of-Process Rasterization) allows a compromised renderer to disclose cross-origin GPU memory. The issue stems from an amplification effect when unpremultiplying displacement map inputs, combined with a failure in Skia's bounds analysis to account for these amplified offsets.
Potential Root Cause
The vulnerability is located in the sk_displacement SkSL function used by SkDisplacementMapImageFilter.
// third_party/skia/src/sksl/sksl_rt_shader.sksl
half4 sk_displacement(shader displMap, shader colorMap, float2 coord,
half2 scale, half4 xSelect, half4 ySelect) {
half4 displColor = unpremul(displMap.eval(coord)); // <--- No clamping
half2 displ = half2(dot(displColor, xSelect), dot(displColor, ySelect));
displ = scale * (displ - 0.5);
return colorMap.eval(coord + displ);
}
The unpremul function divides the RGB components by the alpha channel. In third_party/skia/src/sksl/sksl_shared.sksl, it is defined as color.rgb / max(color.a, 0.0001). If the alpha channel is near zero but the RGB components are non-zero (a 'super-luminescent' color), the result is extremely large (up to 10,000x).
Normally, Skia filters operate on valid premultiplied colors where RGB <= Alpha. However, a compromised renderer can use a cc::ArithmeticPaintFilter with the enforce_pm_color flag set to false to generate such invalid colors. During serialization, cc/paint/paint_op_reader.cc blindly trusts this renderer-provided flag.
Exploitation Mechanism
- Renderer Compromise: The attacker gains control of a renderer and serializes a malicious
PaintFiltergraph containing acc::DisplacementMapEffectPaintFilter. - Arithmetic Filter Manipulation: By setting
enforce_pm_color = falsein anArithmeticPaintFilter, the attacker produces an intermediate texture containing colors like(1.0, 1.0, 1.0, 0.0). - Bounds Analysis Bypass: Skia's
analyzeBoundslogic (inthird_party/skia/src/core/SkImageFilterTypes.cpp) determines whether strict shader-based tiling (clamping to the logical image subset) is required. For approximately-sized (kApprox) scratch textures used in the Ganesh backend, this logic can be fooled into using hardwareCLAMP_TO_EDGEinstead of strict shader-clamping if it believes the sample coordinates will remain within the texture's bounds. Theexactify()mechanism inGrSurfaceProxyexacerbates this by expanding the perceived image dimensions to the full backing-store dimensions. - Massive Displacement: The
sk_displacementshader calculates a displacement of nearly10,000 * scale. This displacement moves the sampling coordinate far outside the intended logical image bounds and into the uninitialized padding of the scratch texture. - Memory Disclosure: In OOP-R, the GPU process uses a shared context where scratch textures are recycled across different renderers and origins. The padding of these textures contains stale data from other tabs. Hardware
CLAMP_TO_EDGEon the backing texture allows sampling this recycled data.
Suggested Reproduction Steps (Potential)
- From a compromised renderer, create a
cc::PaintOpBufferwith acc::DisplacementMapEffectPaintFilter. - Set the
displacementinput to acc::ArithmeticPaintFilterwithenforce_pm_color=falseand coefficients designed to produce super-luminescent output (e.g.,k={0, -1, 0, 1}). - Target a Ganesh-backed canvas. Use a large
scaleto ensure displacement reaches the texture boundaries. - Dispatch a
RasterCHROMIUMcommand. - After rendering, use
canvas.getContext('2d').getImageData()to read back the canvas content and inspect for leaked GPU memory patterns (e.g., fragments of other tabs' content).
Suggested Fix
Ensure that the displacement values are clamped to a safe range before being used to offset sampling coordinates. Applying saturate() to the result of unpremul() in the displacement shader would restrict the displacement to the range [-0.5, 0.5] (relative to scale) as assumed by Skia's bounds analysis.
In third_party/skia/src/sksl/sksl_rt_shader.sksl, modify sk_displacement as follows:
half4 displColor = saturate(unpremul(displMap.eval(coord)));
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
Likely the displacement shader unpremultiplies its input without clamping, and Skia's bounds analysis does not account for the resulting amplified offsets, so hardware edge clamping samples outside the logical image.
Impact
A compromised renderer could disclose cross-origin GPU memory, though this depends on scratch textures being recycled across renderers and origins in the shared GPU context.
What the attacker needed
Attacker already controls a renderer; GPU process uses shared scratch textures
The fix
The displacement colour should be clamped with saturate after unpremultiplying so offsets stay within the range the bounds analysis assumes.
How it was found
- From a compromised renderer, build a paint buffer containing a displacement map effect.
- Feed it an arithmetic filter with premultiplied-colour enforcement disabled that outputs super-luminescent colours.
- Target a Ganesh-backed canvas and use a large scale so the displacement reaches the texture edge.
- Dispatch the raster command to the GPU process.
- Read the canvas back with getImageData and look for leaked GPU memory.
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 web page's drawing is normally done by a separate, sandboxed process, and the graphics library Skia does the actual painting. Skia assumes colours are 'premultiplied', meaning the colour values never exceed the transparency value; this report shows that assumption can be broken so a calculation produces a huge offset. That offset makes the renderer read pixels from memory it should never see, which may still hold content from other websites.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.