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

CVE-2026-106116: ImageSharp BigTIFF DoS Vulnerability

CVE-2026-106116 is a denial of service flaw in ImageSharp 2D graphics library affecting BigTIFF processing. Attackers can exploit malformed files to lock decoder threads indefinitely. This article covers technical details, 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-106116 Overview

ImageSharp, a widely used 2D graphics library for .NET, contains an infinite loop vulnerability in its BigTIFF Exchangeable Image File Format (EXIF) reader. The flaw affects versions 2.0.0 through 4.1.1 and was fixed in version 4.1.2. The ExifReader.ReadValues64 method trusts the attacker-controlled 64-bit Image File Directory (IFD) entry count without validating it against available stream data. A malformed BigTIFF file can cause a decoder thread to loop for an attacker-controlled duration, consuming CPU resources. The vulnerability is tracked under CWE-835 (Loop with Unreachable Exit Condition).

Critical Impact

A small, malformed BigTIFF file can occupy a single decoder thread indefinitely, causing a localized denial-of-service condition on image processing workloads.

Affected Products

  • SixLabors ImageSharp versions 2.0.0 through 4.1.1
  • Applications embedding ImageSharp for EXIF metadata parsing
  • .NET services processing untrusted BigTIFF images

Discovery Timeline

  • 2026-10-06 - CVE-2026-106116 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-106116

Vulnerability Analysis

The vulnerability resides in the BigTIFF directory parsing path of ImageSharp's EXIF reader. BigTIFF extends the classic TIFF format with 64-bit offsets and counts, which allows an attacker to declare an enormous IFD entry count. The ExifReader.ReadValues64 method reads this 64-bit count directly from the file and iterates once per declared entry without first comparing the count to the number of bytes actually remaining in the stream.

When the loop encounters a truncated entry with fewer than 20 bytes remaining, ExifReader.ReadValue64 returns early. It does not advance the stream position and does not terminate the outer loop. Each subsequent iteration repeats the same no-op behavior, pinning one decoder thread on CPU work for the attacker-chosen duration encoded in the count field.

Root Cause

The root cause is missing input validation on an untrusted length field. The parser treats the 64-bit entry count as authoritative instead of bounding it by the physical directory size. Combined with an early-return path in the per-entry reader that neither advances the cursor nor breaks the loop, the result is a classic loop with unreachable exit condition.

Attack Vector

An attacker uploads or submits a crafted BigTIFF file to any endpoint that invokes ImageSharp's EXIF parsing. No authentication or user interaction is required. The impact is limited to availability of a single decoder thread per malicious file. The reporter explicitly notes this does not amount to worker-pool exhaustion on its own.

text
         this.Seek(offset);
         ulong count = this.ReadUInt64();
 
+        // Each entry occupies 20 bytes and the directory ends with an 8-byte next-IFD offset.
+        long remainingDirectoryBytes = this.data.Length - this.data.Position;
+        if (remainingDirectoryBytes < 8 || count > (ulong)((remainingDirectoryBytes - 8) / 20))
+        {
+            throw new InvalidImageContentException("The BigTIFF directory entry count exceeds the available data.");
+        }
+
         Span<byte> offsetBuffer = stackalloc byte[8];
         for (ulong i = 0; i < count; i++)
         {

Source: GitHub Commit 92b12d7. The patch bounds the declared count against the remaining directory bytes and throws InvalidImageContentException when the value is impossible.

Detection Methods for CVE-2026-106116

Indicators of Compromise

  • BigTIFF files (magic number 0x002B in the TIFF header) submitted to image processing endpoints with abnormally small file sizes relative to a very large declared IFD entry count.
  • Decoder threads sustaining 100% CPU utilization while processing a single image request.
  • Image processing requests that exceed normal response time budgets without producing output or errors.

Detection Strategies

  • Instrument image upload handlers with per-request processing time limits and log any request that exceeds the threshold.
  • Monitor for processes hosting ImageSharp assemblies showing sustained single-thread CPU saturation.
  • Inspect inbound TIFF uploads for the BigTIFF version marker and apply stricter size validation before handing them to the decoder.

Monitoring Recommendations

  • Track application performance metrics for image decoding latency percentiles and alert on sudden shifts in the long tail.
  • Correlate upload source IPs with repeated long-running decode operations to identify abuse attempts.
  • Review web application firewall logs for TIFF content types originating from untrusted sources.

How to Mitigate CVE-2026-106116

Immediate Actions Required

  • Upgrade ImageSharp to version 4.1.2 or later across all applications and container images.
  • Audit dependency manifests (csproj, packages.lock.json) for transitive references to vulnerable ImageSharp versions.
  • Apply request-level CPU and wall-clock timeouts on any code path that decodes user-supplied images.

Patch Information

The fix is available in ImageSharp release v4.1.2 and merged via Pull Request #3187. Full remediation details are documented in GitHub Security Advisory GHSA-wmxv-xphr-5c9g. The patch validates that the declared BigTIFF IFD entry count fits within the remaining directory bytes before iteration begins.

Workarounds

  • Reject BigTIFF inputs at the application boundary if your workload only requires classic TIFF or other formats.
  • Enforce strict maximum file size limits on uploaded images to reduce the attainable loop duration.
  • Run image decoding in isolated worker processes with hard CPU time limits enforced by the operating system.
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.