Skip to content

[4.155] Backport the remaining 25 Skia CVE fixes - #5844

Merged
mattleibow merged 2 commits into
mono:release/4.155.xfrom
ramezgerges:dev/backport-4.155-security-batch-3
Nov 24, 2026
Merged

mattleibow merged 2 commits into
mono:release/4.155.xfrom
ramezgerges:dev/backport-4.155-security-batch-3

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

Description

Third 4.155 servicing backport, after #5793 and #5797. It brings the remaining 25 Skia CVE fixes to release/4.155.x, so 4.155 covers all 31 Skia CVEs announced in Chrome desktop stable releases since Chrome 156 (2026-10-27). That matches release/4.157.x.

4.155 is the last line Uno Platform 6 apps can use, so these fixes can't be delivered by asking users to move to a newer SkiaSharp the way 4.156 users can.

Skia security fixes (backported to m155 in mono/skia#471; the Google commit for each is listed there):

CVE Chromium issue
CVE-2026-118348: integer overflow (Critical) 574776938
CVE-2026-118354: uninitialized resource (High) 568936430
CVE-2026-118351: use after free (High) 570825067
CVE-2026-118319: integer overflow (High) 576194994
CVE-2026-119271: uninitialized resource (High) 577403270
CVE-2026-121032: out-of-bounds read (High) 573263908
CVE-2026-121084: out-of-bounds read (High) 574214629
CVE-2026-121227: uninitialized resource (High) 576937680
CVE-2026-121160: out-of-bounds read (High) 577352772
CVE-2026-121072: uninitialized resource (Medium) 553130328
CVE-2026-126846: use after free (Critical) 580857377
CVE-2026-126853: uninitialized resource (High) 573263421
CVE-2026-126898: uninitialized resource (High) 574216555
CVE-2026-126876: integer overflow (High) 576664769
CVE-2026-126844: uninitialized resource (High) 576944655
CVE-2026-126884: out-of-bounds read (High) 576949530
CVE-2026-126894: out-of-bounds read (High) 576950618
CVE-2026-126922: out-of-bounds read (High) 577341943
CVE-2026-126914: uninitialized resource (High) 577346516
CVE-2026-126857: out-of-bounds read (High) 578656869
CVE-2026-126848: uninitialized resource (High) 578685477
CVE-2026-126915: use of uninitialized variable (High) 579276256
CVE-2026-126841: out-of-bounds read (High) 580865537
CVE-2026-126920: information leak (High) 581903854
CVE-2026-131013: buffer overflow (High) 574221485

mono/skia#471 also carries Google's 13 other chrome/m156 fixes that 4.155 lacked: hardening follow-ups to the same glyph and subset-clamp code, the newest M156 fixes (GrBufferAllocPool overflow guard, Graphite depth reset, image-filter mipmap fix), an Imagination FBO workaround and two test-only fixes. Four of its 38 cherry-picks needed hand resolution; the notes are in that PR.

This PR pins externals/skia to mono/skia#471's head bc33dd4a8d and updates cgmanifest.json to match. After mono/skia#471 merges, the pin should move to its merge commit, as was done for #5793 and #5797.

Related issues

Related to #5793 and #5797

Required skia PR

Requires mono/skia#471

Areas affected

  • Managed API (binding/)
  • Native / C API (externals/skia/src/c, include/c)
  • Generated P/Invoke bindings
  • Native dependency or Skia update (libpng, HarfBuzz, FreeType, zlib, milestone bump, …)
  • Views & integrations (MAUI, Uno, WPF, WinUI, Blazor, …)
  • Rendering output / visual behavior
  • Performance
  • Tests
  • Build, packaging, or CI
  • Documentation or samples

Changes

None. Public API, C API, bindings and package versions are unchanged.

Behavior

  • Skia rejects or clamps the malformed inputs behind these CVEs instead of reading or writing out of bounds, using freed or uninitialized resources, or overflowing. This matches 4.157.x.
  • Ganesh skips draws whose deferred texture uploads failed instead of sampling unwritten memory (CVE-2026-121072).
  • Vulkan: VK_ERROR_UNKNOWN is treated as device lost, and affected GPUs sleep 1 ms after vkQueueSubmit/vkQueueWaitIdle on device loss (CVE-2026-118354, CVE-2026-126846).

Testing

  • Every CVE was mapped from its Chromium issue in the Chrome release notes to the Skia commit that names it in its Bug:/Fixed: footer; all 31 are now on this branch.
  • All 44 changed Skia C++ sources pass a syntax-only clang compile against m155 (details in [m155] Backport the remaining 25 Skia CVE fixes skia#471). Metal and Direct3D sources could not be checked locally.
  • Natives were not built locally. This PR's CI builds them from the pinned commit on every platform and runs the test suites.

Checklist

  • Tests added or updated (if omitted, explain why above). The upstream regression tests travel with the Skia backport. The managed suites cannot exercise these GPU, glyph and SkSL internals with malicious inputs.
  • Changes above lists all public API and behavioral changes (or "None.")
  • New/changed public API? Added or updated accurate source /// documentation and regenerated bindings when applicable
  • Native change? Companion mono/skia PR linked above and bindings regenerated (no C API change, so there is nothing to regenerate)

🤖 Generated with Claude Code

Pins externals/skia to mono/skia's dev/backport-4.155-security-batch-3
(bc33dd4a8d), which cherry-picks every Skia fix Google shipped for the 31
Skia CVEs announced in Chrome stable since 156 (2026-10-27) that 4.155.x
didn't have yet, plus Google's other M156 fixes to the same code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 5844

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5844"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5844/packages --name skiasharp-pr-5844
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-5844

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @ramezgerges! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

mattleibow added a commit to mono/skia that referenced this pull request Nov 24, 2026
[m155] Backport Skia security fixes and stable hardening (#471)

Context: #461
Context: #462
Context: mono/SkiaSharp#5844
Changes: e6cfc7a...bc33dd4

Backport Google's remaining 25 identified Skia CVE fixes to the m155
servicing line, together with related stable hardening and regression tests.
This keeps fixes available to applications that cannot move beyond 4.155,
including Uno Platform 6 applications.

The commits preserve their upstream cherry-pick ancestry. Context adjustments
retain m155 tests and combine deferred-upload failure handling with the earlier
flush-token fix.

~~ Raster pipeline overflow and failed shader construction ~~

Guard slot counts and temporary stack depths against overflow and reject
negative allocation sizes (CVE-2026-118348, CVE-2026-118319). Neutralize
pending branches on failed pipeline construction and propagate child shader
failure rather than executing an incomplete pipeline (CVE-2026-121084).

~~ Resource ownership and deferred uploads ~~

Hold a cache reference while changing a resource's unique key so a
zero-refcount resource is not left in the purgeable queue
(CVE-2026-118351).

Propagate deferred texture upload failures, skip affected draws, and evict
failed atlas plots rather than sampling unwritten texture memory
(CVE-2026-121072). Advance atlas flush tokens even on flushes without draws
(CVE-2026-126844).

~~ Vulkan device-loss handling ~~

Treat VK_ERROR_UNKNOWN as device loss (CVE-2026-118354), initialize the
current render-pass pointer (CVE-2026-126915), and apply the upstream 1 ms
device-loss delay on affected GPUs (CVE-2026-126846). Also check
vkWaitForFences results.

~~ Texture subset and coverage boundaries ~~

Nearest filtering can round magnified samples outside touching subset edges.
Keep clamping unless the transform meets the safe 1:1 integer-translation
conditions (CVE-2026-121227). Clamp coverage-mask sampling
(CVE-2026-126884), and account for AA coordinate extrapolation when deciding
whether image-filter subsets need strict bounds.

~~ Direct-mask Slug validation ~~

Direct masks without atlas bilinear support have no glyph padding. Reject
incompatible fractional replay (CVE-2026-126894), and validate deserialized
positions, matrices, bounds, and flags before they reach atlas sampling
(CVE-2026-126922). Direct positions are constrained to finite integers
within +/-2^21; the boolean wire format remains unchanged.

~~ Glyph allocation and scaler bounds ~~

Check SDF dimensions and scratch-buffer arithmetic, use fallible allocation,
and avoid rasterizing oversized glyphs that will not fit the atlas
(CVE-2026-126876).

Guard the second, unfiltered glyph load before it aliases the original
buffer (CVE-2026-131013). Harden mask-filtered image copies and LCD16
cropping when stateful scalers return different bounds or formats on
subsequent loads.

~~ Graphite clip and stroke bounds ~~

Include hairlines and subpixel strokes in clip inflation
(CVE-2026-121160), and correct wedge miter inflation (CVE-2026-126841).
Treat inverse fills covering the scissor as flood fills
(CVE-2026-126898). Use a save-record key when clip-path bounds cannot fit
the packed int16 representation (CVE-2026-126857).

~~ Ganesh stroke geometry ~~

Compute op bounds in device space to match tessellation
(CVE-2026-126914). Handle negative determinants when constructing hairline
square caps, checking the resulting inverse determinant for finiteness
(CVE-2026-126848).

~~ GPU transfer and texture formats ~~

Disable unsupported BGRA-as-RGBx writes on GLES (CVE-2026-119271).
For Graphite A-to-RGBx readback, use RGBA with forced opaque alpha so the
transfer writes the expected destination bytes (CVE-2026-126853).

~~ Shader and cache key correctness ~~

Compare the full byte length of Graphite PaintParamsKey data rather than
its element count (CVE-2026-121032). Align image-filter cache equality with
its byte-based hash, including the type mask. Use float2 displacement
offsets so filter calculations agree with fp32 bounds.

~~ Atlas index interpolation ~~

Apply the half-step and integer conversion to Ganesh atlas indices because
flat interpolation is a hint, not a guarantee (CVE-2026-126920).

~~ Driver framebuffer lifetime ~~

Replace the Imagination framebuffer workaround with a persistent complete
guard FBO and bind it around framebuffer changes. This prevents a deleted
FBO from remaining the driver's previous binding.

~~ Allocation overflow and painter order ~~

Guard GrBufferAllocPool alignment, size additions, and byte multiplications;
make CPU buffer allocation fallible and bound preallocation.

Reset Graphite depth and bounds tracking when a draw discards earlier draws
because it overwrites all pixels, preventing depth wrap from changing
painter order.

~~ Image-filter mipmaps ~~

Share the mipmap downgrade logic between SpecialImage drawing paths so
image filtering does not incorporate unwritten scratch-texture contents.
Include the upstream regression tests and their unused-function compile fix.

The backports retain upstream regression tests and their build registration.
Local validation reported syntax-only checks of changed C++ sources; Metal
and Direct3D sources were not checked locally.

Co-authored-by: Alexis Cruz-Ayala <[email protected]>
Co-authored-by: Greg Daniel <[email protected]>
Co-authored-by: Julia Lavrova <[email protected]>
Co-authored-by: Jorge Betancourt <[email protected]>
Co-authored-by: Michael Ludwig <[email protected]>
Co-authored-by: Nathan Sanchez <[email protected]>
Co-authored-by: Robert Phillips <[email protected]>
Co-authored-by: Thomas Smith <[email protected]>
mono/skia release/4.155.x advanced from bc33dd4a8d9028d2303cef3ccd4a636ad2262a00 to 6b4b729abd0d8cc4805d373cc6a469f8eac66655.
@mattleibow
mattleibow enabled auto-merge (squash) November 24, 2026 12:53
@mattleibow
mattleibow disabled auto-merge November 24, 2026 12:54
@mattleibow
mattleibow merged commit a7e1694 into mono:release/4.155.x Nov 24, 2026
94 of 111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants