CVE-2026-106118 — Vulnerability in SixLabors.ImageSharp — CVE Details
ImageSharp: Tiled fax TIFF: tile buffer sized by TileWidth but fax decompressor writes scanlines of ImageWidth — heap OOB write
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.63%). Schedule for your next planned update.
Does your project use an affected SixLabors.ImageSharp version?
Paste your packages.lock.json to check it for CVE-2026-106118 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
When decoding a tiled TIFF with fax compression (T4/T6/MH), DecodeTilesChunky allocates each tile buffer from TileWidth (ceil(TileWidth*bpp/8)*TileLength bytes) but constructs the fax decompressor with frame.Width: TiffDecompressorsFactory ignores the isTiled/tileWidth/tileHeight parameters entirely. The T4/T6/MH decompressors treat the full image width as the scanline length and advance (and really write, via read-modify-write bit ops) frame.Width bits per row, with no bounds check against the tile buffer. The very first tile therefore writes linearly out of bounds — about ImageWidth/8 bytes per row × TileLength rows into a TileWidth-sized buffer. With ImageWidth=4,000,000, TileWidth=16, TileLength=16 this writes ~2 MB past a 32-byte buffer and kills the process deterministically; a T6 all-white variant advances the bit offset by >512 MB silently, showing an alarm-free heap-corruption window for the same defect. A crafted file fully controls the OOB length per tile and works with perfectly legal per-row run codes (no overlong runs needed).
Verified at commit 5cd4d0d26a82a9549f297a237aea9cf665bddff8 (main; latest release v4.1.0, the supported major).
Details
Root cause: a size mismatch between tile buffer allocation and decompressor width, because the factory drops the tile parameters.
- Allocation: TiffDecoderCore.cs#L792-L794 —
bytesPerTileRow = RoundUpToMultipleOfEight(tileWidth*bitsPerPixel); tile buffer =bytesPerTileRow*tileLengthbytes (32 bytes in the PoC) - Mismatch: TiffDecoderCore.cs#L797 —
CreateDecompressor<TPixel>(frame.Width, ..., isTiled: true, tileWidth, tileLength)passes the full frame width - Factory drops tile params: TiffDecompressorsFactory.cs#L56-L64 — T4/T6/MH decompressors receive only
width(= frame.Width);isTiled/tileWidth/tileHeightignored - OOB write sink: T4TiffCompression.cs#L69-L119,
T6TiffCompression.cs#L76-L108— per-row advance ofthis.widthbits viaBitWriterUtils.WriteBitswith no buffer-length check (BitWriterUtils.cs#L51); noteTiffDecoderCore.cs:829-831later reads the buffer inbytesPerTileRowstrides, confirming the protocol expects tile-width rows
Attack surface: Image.Load(stream) on an attacker-supplied tiled TIFF (TiffDecoderCore.DecodeImageWithTiles → DecodeTilesChunky). Default configuration; only requirement is a standard tiled TIFF header (TileWidth=16, TileLength=16) + Compression=3 (T4; T6 also constructible).
Suggested remediation:
- Short-term: when
isTiled, construct the T4/T6/MH decompressor withtileWidth(not frame width), or clip row writes to the caller-provided buffer length. - Root fix: bound the write side of
BitWriterUtils(pass remaining bits), and validate every fax row advance against buffer capacity on both tiled and strip paths. - Regression tests: Compression=2/3/4 × tiled with TileWidth < ImageWidth, including a T6 black-pixel row (forces real
WriteBit).
PoC
Full PoC posted as the first comment below: Program.cs (driver), poc-tiled-t4.tif (crafted file, ~9.8 KB, base64 inline), README.
-
Build a small console project referencing
src/ImageSharp/ImageSharp.csprojand run it against the crafted file (or callImage.Loadon it from any host). -
Observed with ImageWidth=4,000,000, TileWidth=16, TileLength=16, T4 with 400 makeup codes + EOL per row:
tile payload 9642 bytes; rows write ~2,048,000 bytes into a 32-byte buffer Fatal error. System.AccessViolationException: Attempted to read or write protected memory. at SixLabors.ImageSharp.Formats.Tiff.Compression.BitWriterUtils.WriteBits(Span`1<Byte>, IntPtr, IntPtr, Byte) at ...T4TiffCompression.WritePixelRun(...) at ...T4TiffCompression.Decompress(...) Aborted (core dumped); exit=134 -
Controls: the same file with Compression=None decodes normally (container is fine); a T6 all-white-rows variant advances >512 MB of bit offset without a real write (silent corruption window) before tripping on a directory-level TileOffsets count check.
Impact
- What it is: out-of-bounds write (CWE-787). For any service decoding untrusted tiled TIFFs: remote, default-configuration, deterministic process crash (DoS), plus a heap OOB write whose per-tile length and row width are attacker-tunable — a potential code-execution surface. This is a vulnerability in the library itself, in scope of your SECURITY.md.
- Who is impacted: applications decoding untrusted TIFF with SixLabors.ImageSharp at the current major (verified on main past v4.1.0); tiled + fax-compressed files are the trigger, which ordinary TIFF writers can produce.
Reported by Kimi Security Team (bug-report@moonshot.ai).
Advisory Timeline
- First published October 7, 2026 (50 days ago).
- Last revised October 26, 2026 — 19 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
dotnet add package SixLabors.ImageSharp --version 4.1.1
dotnet add package SixLabors.ImageSharp --version 3.2.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: NuGet (1).
| Package | Fixed In |
|---|---|
| SixLabors.ImageSharp NuGet · Affected: 4.0.0, 4.1.0 | 4.1.1 |
| SixLabors.ImageSharp NuGet · Affected: 3.0.0, 3.0.1, 3.0.2, 3.1.0 (+12 more) | 3.2.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-787Out-of-bounds WriteMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/SixLabors/ImageSharp/security/advisories/GHSA-v76p-62qx-wwq2WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-106118ADVISORY
- https://github.com/SixLabors/ImageSharp/pull/3176WEB
- https://github.com/SixLabors/ImageSharp/pull/3208WEB
- https://github.com/SixLabors/ImageSharp/commit/9ee7d1dd5b62d8c9f16cc755e76828386bc2191fWEB
- https://github.com/SixLabors/ImageSharp/commit/baa37cd19077b2a2a0c5667535111cf31d48c019WEB
- https://github.com/SixLabors/ImageSharpPACKAGE
- https://github.com/SixLabors/ImageSharp/releases/tag/v3.2.0WEB
- https://github.com/SixLabors/ImageSharp/releases/tag/v4.1.1WEB
Frequently Asked Questions
- What is CVE-2026-106118?
- ImageSharp: Tiled fax TIFF: tile buffer sized by TileWidth but fax decompressor writes scanlines of ImageWidth — heap OOB write. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2026-106118?
- CVE-2026-106118 affects SixLabors.ImageSharp. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-106118 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 44.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2025-27598HIGH
Out-of-bounds Write in SixLabors ImageSharp
- CVE-2024-41131HIGH
SixLabors ImageSharp Out-of-bounds Write
- CVE-2024-27929HIGH
Use After Free in SixLabors.ImageSharp
- CVE-2026-106112HIGH
ImageSharp: ICC LUT16 output channel count can write beyond Vector4
- CVE-2026-106113HIGH
ImageSharp: HistogramEqualization uses an unvalidated luminance as an unchecked histogram index
- CVE-2026-106111MEDIUM
ImageSharp: EXR ZIP decoder can expose stale allocator data after a short inflate
- CVE-2024-32036MEDIUM
SixLabors.ImageSharp vulnerable to data leakage
- CVE-2024-32035MEDIUM
SixLabors.ImageSharp vulnerable to Memory Allocation with Excessive Size Value