Skip to main content
Vulnerability Database/CVE-2026-106115

CVE-2026-106115: ImageSharp TIFF Buffer Overflow Vulnerability

CVE-2026-106115 is a buffer overflow flaw in ImageSharp 2D graphics library affecting TIFF CCITT Group 4 encoding that can corrupt memory and crash processes. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-106115 Overview

CVE-2026-106115 is an out-of-bounds write vulnerability [CWE-787] in SixLabors ImageSharp, a widely used .NET 2D graphics library. The flaw resides in the TIFF CCITT Group 4 encoder, where T6BitCompressor.CompressStrip can write encoded row data and two 12-bit end-of-facsimile-block codes past the allocated output buffer. The buffer is sized as Width * rowsPerStrip bytes, which does not account for worst-case encoded output. Attackers who supply a crafted image through a decode-and-re-encode pipeline can trigger memory corruption and process termination. Versions 2.1.0 through 4.1.1 are affected, and the issue is fixed in 4.1.2.

Critical Impact

Remote attackers can corrupt memory and crash applications that re-encode attacker-supplied images using ImageSharp's TIFF CCITT Group 4 compression path.

Affected Products

  • SixLabors ImageSharp versions 2.1.0 through 4.1.1
  • Applications performing TIFF decode-and-re-encode workflows with CcittGroup4Fax compression
  • .NET services that accept user-supplied images and process TIFF output

Discovery Timeline

  • 2026-10-06 - CVE-2026-106115 published to the National Vulnerability Database
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-106115

Vulnerability Analysis

The vulnerability affects ImageSharp's TIFF encoder implementation of CCITT Group 4 facsimile compression. TiffCcittCompressor.WriteCode performs unchecked bitwise writes into an output buffer allocated as Width * rowsPerStrip bytes. This sizing assumes a one-byte-per-pixel upper bound, which does not hold for CCITT encoded output. Each pixel can require up to a 13-bit terminating code, and each row introduces additional transition overhead and an end-of-line (EOL) marker. The Group 4 (T6) variant also appends two 12-bit end-of-facsimile-block (EOFB) codes after the final row. When the encoder emits more bits than the buffer can hold, it writes beyond the allocation and corrupts adjacent memory.

Root Cause

The root cause is incorrect buffer-size calculation in the CCITT encoder's output allocation logic combined with the absence of bounds checks in WriteCode. The compressor trusts that Width * rowsPerStrip bytes will accommodate any encoded strip, but worst-case CCITT output exceeds that bound. Compression metadata and the one-bit pixel format can be inherited from an attacker-supplied TIFF through a decode-and-re-encode flow, giving the attacker control over the encoding path.

Attack Vector

An attacker uploads a crafted TIFF image to a service that uses ImageSharp to decode and re-encode images. If the decoded image inherits TiffCompression.CcittGroup4Fax and one-bit pixel metadata, the encoder path is triggered on untrusted data. The resulting out-of-bounds write corrupts heap memory and can terminate the process, producing a denial-of-service condition.

csharp
// Security patch in T6BitCompressor.cs - correctly size CCITT Group 4 output buffers
protected override long GetMaximumEncodedBits(int rowsPerStrip)
{
    // Alternating pixels use at most 29 bits per two-pixel horizontal mode.
    // Allow 16 bits per pixel, row transition overhead, and the final 24-bit EOFB.
    return ((((long)this.Width * 16) + 24) * rowsPerStrip) + 24;
}

// Companion fix in T4BitCompressor.cs
protected override long GetMaximumEncodedBits(int rowsPerStrip)
{
    // A pixel can require a 13-bit terminating code. Each row can also require
    // an 8-bit zero-length white run and a 12-bit EOL, plus the initial EOL.
    return 12L + ((((long)this.Width * 13) + 20) * rowsPerStrip);
}

Source: GitHub commit a9498c6

Detection Methods for CVE-2026-106115

Indicators of Compromise

  • Unexpected process termination or crash dumps in services that re-encode TIFF images
  • Access violation or heap corruption exceptions originating in SixLabors.ImageSharp.Formats.Tiff namespace
  • Spikes in TIFF uploads containing one-bit CcittGroup4Fax compressed data from untrusted sources

Detection Strategies

  • Inventory .NET applications and container images for SixLabors.ImageSharp dependencies at versions >= 2.1.0 and < 4.1.2 using software composition analysis.
  • Instrument image-processing endpoints with structured exception logging to catch out-of-bounds write symptoms in the TIFF encoder path.
  • Monitor crash telemetry for stack frames referencing T6BitCompressor.CompressStrip or TiffCcittCompressor.WriteCode.

Monitoring Recommendations

  • Alert on repeated process crashes or container restarts correlated with TIFF file uploads.
  • Log and review image metadata on ingress, flagging TIFF files declaring Compression=4 (Group 4 fax) from external sources.
  • Track dependency manifests (.csproj, packages.lock.json) in CI pipelines to block builds that pull vulnerable ImageSharp versions.

How to Mitigate CVE-2026-106115

Immediate Actions Required

  • Upgrade all SixLabors.ImageSharp references to version 4.1.2 or later.
  • Audit image-processing services for decode-and-re-encode flows that inherit source compression metadata.
  • Rebuild and redeploy container images and application artifacts that bundle the vulnerable library.

Patch Information

The fix shipped in ImageSharp Release v4.1.2 via Pull Request #3187 and commit a9498c6. The patch introduces GetMaximumEncodedBits in both T4BitCompressor and T6BitCompressor to size output buffers against worst-case CCITT encoding plus EOL and EOFB overhead. Full technical context is in the GitHub Security Advisory GHSA-jjfr-hcj7-qf5w.

Workarounds

  • Override inherited TIFF compression when re-encoding, forcing a non-CCITT codec such as Deflate or Lzw until patching is complete.
  • Reject or transcode uploaded TIFF files declaring Group 4 fax compression at the application gateway.
  • Constrain accepted image dimensions and pixel formats to reduce the attack surface against the vulnerable encoder path.
bash
# Upgrade ImageSharp to the patched release
dotnet add package SixLabors.ImageSharp --version 4.1.2

# Verify no vulnerable versions remain in the dependency graph
dotnet list package --include-transitive | grep -i imagesharp

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.