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

CVE-2026-106113: ImageSharp DOS Vulnerability

CVE-2026-106113 is a denial of service vulnerability in ImageSharp affecting versions 2.0.0 to 4.1.2. The flaw occurs when decoding malicious TIFF files, causing process termination. This article covers technical details, impact, and mitigation.

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-106113 Overview

CVE-2026-106113 is an out-of-bounds write vulnerability [CWE-787] in SixLabors ImageSharp, a widely used 2D graphics library for .NET. The flaw affects versions 2.0.0 through 4.1.1. An attacker who supplies a crafted 32-bit floating-point TIFF image can trigger non-finite or out-of-range luminance values when the image is decoded as Image<HalfVector4> and processed with HistogramEqualization. The resulting value is used as an unchecked histogram offset, causing an unsafe out-of-range memory access and process termination. Adaptive Histogram Equalization and AutoLevel operations are not affected. Version 4.1.2 remediates the issue.

Critical Impact

Remote attackers can crash any .NET service that decodes untrusted floating-point TIFF images and applies HistogramEqualization, resulting in denial of service.

Affected Products

  • SixLabors ImageSharp 2.0.0 through 4.1.1
  • Any .NET application processing attacker-controlled TIFF files with HistogramEqualization
  • Image processing pipelines handling Image<HalfVector4> with floating-point TIFF inputs

Discovery Timeline

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

Technical Details for CVE-2026-106113

Vulnerability Analysis

The vulnerability resides in the ColorNumerics.GetBT709Luminance helper used by ImageSharp's histogram equalization pipeline. The function computes a luminance value using a dot product against the BT.709 coefficient vector and converts the result to an integer histogram bin index. When the input image is a 32-bit floating-point TIFF decoded as Image<HalfVector4>, pixel channels can hold values outside the normalized [0,1] range, including NaN, infinity, or negative numbers. These values propagate directly through the dot product.

The computed index is then consumed by GrayscaleLevelsRowOperation.Invoke as an offset into the histogram buffer without validation. A non-finite or out-of-range index produces an unsafe out-of-bounds access, terminating the host process.

Root Cause

The root cause is missing input validation on floating-point luminance values before they are cast to an array index. The original implementation assumed pixel data was already clamped to the normalized range, which is not guaranteed for floating-point pixel formats. Neither NaN handling nor range clamping was performed prior to the integer cast and multiplication.

Attack Vector

Exploitation requires an attacker to supply a crafted 32-bit floating-point TIFF file to an application that decodes it as Image<HalfVector4> and invokes HistogramEqualization. The attack is network-reachable in any service that accepts user-uploaded images, such as web applications, document converters, and image processing APIs. No authentication or user interaction is required beyond submitting the malicious file.

text
     /// </param>
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
     public static int GetBT709Luminance(Vector4 vector, int luminanceLevels)
-        => (int)MathF.Round(Vector4.Dot(vector, Bt709) * (luminanceLevels - 1));
+    {
+        float luminance = Vector4.Dot(vector, Bt709);
+        if (float.IsNaN(luminance))
+        {
+            return 0;
+        }
+
+        // Floating-point pixel formats can contain values outside their normalized range.
+        luminance = Math.Clamp(luminance, 0F, 1F);
+        return (int)MathF.Round(luminance * (luminanceLevels - 1));
+    }

Source: SixLabors/ImageSharp commit c4c4bf2. The patch adds a NaN check that returns 0 and clamps the luminance to [0F, 1F] before computing the histogram index.

Detection Methods for CVE-2026-106113

Indicators of Compromise

  • Unexpected process termination or crash in .NET services that handle image uploads, correlated with TIFF file processing.
  • Access violation or IndexOutOfRangeException stack traces referencing GrayscaleLevelsRowOperation.Invoke or ColorNumerics.GetBT709Luminance.
  • Inbound TIFF uploads with 32-bit floating-point sample format (SampleFormat=3, BitsPerSample=32) from untrusted sources.

Detection Strategies

  • Inventory .NET application dependencies for SixLabors.ImageSharp at versions >=2.0.0 <4.1.2 using software composition analysis.
  • Instrument image processing endpoints with structured logging around decode and HistogramEqualization calls to capture crash context.
  • Inspect uploaded TIFF headers at the application gateway and flag files declaring floating-point sample formats combined with unusual pixel ranges.

Monitoring Recommendations

  • Monitor Windows Error Reporting, systemd-coredump, or container restart counts for repeated crashes of image processing workers.
  • Alert on sudden spikes in HTTP 5xx responses from endpoints that accept image uploads.
  • Collect and centralize .NET exception telemetry to identify out-of-range access patterns originating from ImageSharp.

How to Mitigate CVE-2026-106113

Immediate Actions Required

  • Upgrade SixLabors.ImageSharp to version 4.1.2 or later in all affected projects and redeploy.
  • Audit codebases for calls to HistogramEqualization that process untrusted images and gate them behind the patched version.
  • Restart long-running .NET services after upgrading to ensure the vulnerable assembly is unloaded from memory.

Patch Information

The fix is included in ImageSharp v4.1.2 and documented in GHSA-j3p4-wp97-rph4. The code change is tracked in pull request #3187 and clamps luminance values and handles NaN before computing histogram indices.

Workarounds

  • Switch to AdaptiveHistogramEqualization or AutoLevel, which are not affected by this issue, until upgrading is feasible.
  • Reject TIFF uploads whose header declares floating-point sample formats at the ingress layer before they reach the ImageSharp decoder.
  • Pre-process images into a bounded integer pixel format such as Rgba32 before invoking HistogramEqualization.
bash
# Upgrade ImageSharp to the patched version
dotnet add package SixLabors.ImageSharp --version 4.1.2

# Verify installed version across a solution
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.