{"dataType":"CVE_RECORD","dataVersion":"1.0","cveMetadata":{"cveId":"GCVE-110-HSEC-2026-0017","assignerOrgId":"","assignerShortName":"Vulnetix","state":"PUBLISHED","datePublished":"2026-11-23T04:01:22Z","dateUpdated":"","dateReserved":""},"containers":{"cna":{"providerMetadata":null,"title":"","descriptions":[{"lang":"en","value":"Out-of-bounds writes in BMP RLE and TIFF strip decoding","supportingMedia":null},{"lang":"en","value":"# Out-of-bounds writes in BMP RLE and TIFF strip decoding\n\nJuicyPixels contains independent out-of-bounds writes reachable from ordinary\nimage decoding (`Codec.Picture.decodeImage` and the format-specific decoders):\n\n1. **BMP `BI_RLE8`/`BI_RLE4`** (`Codec.Picture.Bitmap.decodeImageY8RLE`): the\n   pixel buffer size is computed with 32-bit `Int32` arithmetic and wraps to a\n   zero-length allocation for large headers; end-of-line and vertical-delta\n   control codes move the destination cursor without a bound, and the\n   horizontal delta jump is unclamped. Every run writes attacker-chosen bytes\n   through `M.unsafeWrite` at the cursor position — negative offsets before\n   the raster, arbitrary offsets against a wrapped allocation, and up to 255\n   bytes past it.\n2. **TIFF uncompressed/PackBits contiguous strips**\n   (`Codec.Picture.Tiff.gatherStrips`, `copyByteString`, `unpackPackBit`):\n   strip copies have no destination bound and the per-strip size computation\n   wraps negative for strips starting past the raster, so excess strips copy\n   attacker-chosen bytes past the end of the allocated raster.\n\nImpact: heap memory adjacent to the decoded image is corrupted with\nattacker-selected values and offsets through maliciously crafted BMP or TIFF\nfiles. Beyond corruption, exploitation primitives were demonstrated\nend-to-end on GHC 9.6 / linux-amd64: a crafted BMP deterministically crashed\nthe process via the wrapped allocation; against a warp-based service a single\nuploaded BMP overwrote another request's in-memory session blob, observed in\nthe victim's own HTTP response (12 of 12 cycles); and with heap grooming the\nwrite primitive was used to redirect a lazily-evaluated top-level `String`\npassed to `callCommand`, executing attacker-supplied commands (3 of 3 runs).\nThese are relative-offset primitives: the demonstrated RCE depends on heap\nlayout and linkage and is not a guaranteed arbitrary-address write.\n\nThe fix, released in 3.3.10, validates the declared pixel count centrally in\n`decodeBitmapWithPaletteAndMetadata` (cap 2^29 pixels, i.e. 2 GiB of RGBA8),\ncomputes all decoder buffer sizes in exact 64-bit `Int` arithmetic, clips\nout-of-bounds BMP RLE writes to the raster (zero-filling skipped pixels,\nmatching the clipping behaviour of the non-RLE decoders and the Windows WIC\ndecoder), bounds TIFF strip copies at the destination buffer, and clamps\nstrip counts at the raster boundary. Malformed-but-decodable files keep\ndecoding instead of failing.\n\nResidual risk in 3.3.10: the shared GIF/TIFF LZW decoder\n(`Codec.Picture.Gif.Internal.LZW`) retains an unguarded single-byte\nKwKwK write reachable from the same TIFF/GIF decode paths; it is\ndocumented as a follow-up and is not addressed by this release.\n\nCredit: external vulnerability report by Akash Sebastian (@akashseb) and Tomer\nFichman (irregular).","supportingMedia":null}],"references":[{"url":"https://github.com/haskell-github-trust/Juicy.Pixels/commit/9c9a3d75ed0a998b5bfd49534a364a9e52e74ba2","name":"","tags":["patch"]},{"url":"https://github.com/haskell/security-advisories/blob/main/advisories/published/2026/HSEC-2026-0017.md","name":"","tags":["advisory"]}],"metrics":[{"format":"","scenarios":null,"cvssV2_0":null,"cvssV3_0":null,"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"cvssV4_0":null,"other":null}],"problemTypes":[{"descriptions":[{"lang":"en","description":"CWE-787","cweId":"CWE-787","type":"CWE"}]}],"affected":[{"vendor":"haskell","product":"JuicyPixels","collectionURL":"https://hackage.haskell.org","packageName":"JuicyPixels","repo":"","defaultStatus":"","versions":[{"version":"3.1.3","status":"affected","versionType":"semver","lessThan":"3.3.10","lessThanOrEqual":"","changes":null}],"cpes":null,"modules":null,"programFiles":null,"platforms":null}],"cpeApplicability":null,"rejectedReasons":null,"replacedBy":null},"adp":null}}