CVE-2026-112403
CriticalCVSS 9.2Summary
Pillow prior to 13.0.0 has a JPEG decoder vulnerability where a full-width scanline can be written into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width after scaling, and an 8-bit lossless SOF3 JPEG decoded by libjpeg-turbo 3.x can ignore the requested downscaling geometry.
Risk Assessment
Supplying a crafted JPEG to an application using draft() or thumbnail() can corrupt heap memory, crash the process, or potentially allow code execution.
Recommendation
Update Pillow to version 13.0.0 or later.
Other vulnerabilities in Pillow
See all- CVE-2026-112897High
In Pillow from 5.3.0 until 13.0.0, the library can return uninitialized memory as pixels when libtiff performs a short decode of JPEG-compressed or Group 4 fax TIFF data. The _decodeStrip and _decodeTile buffers can be larger than the bytes written by libtiff, and Pillow does not clear the unwritten tail. An attacker can supply a crafted TIFF to an application that loads and returns or re-encodes its pixels.
- CVE-2026-112896High
In Pillow prior to 13.0.0, the TIFF encoder can read beyond a ColorMap buffer when retained TIFF metadata has a plane size inconsistent with BitsPerSample. A small TIFF can be opened normally and then retain a crafted ColorMap that is reused when the image is saved. An application that re-encodes the attacker's TIFF with libtiff can trigger the out-of-bounds read.
- CVE-2026-112895High
In Pillow from 5.1.0 until 13.0.0, the library can exhaust resources while parsing an existing PDF during an append operation. PdfParser follows page-tree child references without cycle or duplication tracking and follows previous-trailer chains with only an exact repeated-offset guard, so deep or cyclic page trees and long chains of unique trailer offsets can exhaust the Python stack. An attacker can supply such a PDF to an application that calls Image.save with PDF append enabled.
- CVE-2026-112894High
In Pillow from 5.1.0 until 13.0.0, reserving PDF object identifiers when saving many frames with save_all enabled takes quadratic time. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application that converts it to a multipage PDF.
- CVE-2026-112893High
In Pillow from 10.0.0 until 13.0.0, the library can free an invalid glyph pointer during FreeType rendering with an active stroker. If FT_Load_Glyph fails, cleanup may call FT_Done_Glyph on an uninitialized or stale glyph variable. An attacker can supply a malformed font as untrusted bytes to an application that draws text with a nonzero stroke width.
- CVE-2026-112892High
In Pillow from 4.1.0 until 13.0.0, the MSP RLE decoder can expand a small file into an unbounded in-memory buffer. The decoder writes run-length output to BytesIO without limiting expansion to the declared image size. An attacker can supply a crafted MSP image to an application that loads its pixels.
- CVE-2026-112406High
In Pillow from 5.1.0 until 13.0.0, the library can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF.
- CVE-2026-112405High
In Pillow from 12.0.0 until 13.0.0, Image.merge() can dereference a null image8 plane. Validation skips the first input band, allowing a 32-bit integer or floating-point image backed by image32 storage to be merged as a narrower multiband image. A crafted IPTC file can reach this path when an application opens and loads it, or a caller can invoke Image.merge() directly with such a first band.
- CVE-2026-112404High
In Pillow from 8.1.0 until 13.0.0, the TIFF tile and RGBA decode paths can read beyond row data produced by libtiff. In _decodeTile and the RGBA unpacker path, when Pillow and libtiff interpret duplicated PhotometricInterpretation or BitsPerSample tags differently, Pillow does not verify that the required input row fits inside the row libtiff produced (the strip path has this validation). Loading pixels from such a crafted TIFF can expose adjacent heap data in output pixels or crash the process.
- CVE-2026-112402High
Pillow before version 13.0.0 can double free image memory when ImagingScaleAffine encounters a selective allocation failure. This affects the fast path for Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with default NEAREST resampling. An attacker can trigger the failure by driving a large Image.transform() operation under memory pressure.
Original NVD description (English source)
Pillow is a Python imaging library. Prior to 13.0.0, Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width and component count after scaling is requested, and an 8-bit lossless SOF3 JPEG decoded by a build linked to libjpeg-turbo 3.x can ignore the requested downscaling geometry. An attacker can supply such a JPEG to an application that uses draft() or thumbnail() to request downscaling. This can corrupt heap memory, crash the process, or potentially allow code execution. Older libjpeg-turbo 2.x and IJG builds reject the SOF3 input. This issue is fixed in version 13.0.0.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

