Skip to content

← Public intelligence

PyPI package

pillow

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

117 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. High, CVSS 7.5PyPIAmendedPublished

    Pillow BdfFontFile: Image.new() called without _decompression_bomb_check() — bomb protection bypass via font loading

    CVE-2026-55379 · GHSA-45hq-cxwh-f6vc

    Affected
    • PyPI pillow < 12.3.0
    Fixed in
    12.3.0· Vendor fix available
    Issue
    PIL/BdfFontFile.py bdfchar() (lines 84–88) reads the BBX width height field from a BDF font file and passes the dimensions directly to Image.new() without calling Image.decompressionbombcheck(). This completely bypasses Pillow's documented decompression bomb protection. Image.open() enforces MAXIMAGEPIXELS = 89,478,485 and raises DecompressionBombError for images exceeding 2 × MAX = 178,956,970 pixels. The BDF font loading path calls Image.new() directly, which only calls checksize() (validates = 0) — no pixel count limit. Vulnerable code (PIL/BdfFontFile.py lines 84–88): Attack trigger: A BDF glyph with BBX 20000 20000 and an empty BITMAP section causes Image.frombytes() to raise ValueError, then Image.new("1", (20000, 20000)) allocates 50 MB of C-heap silently. Image.open() would raise DecompressionBombError for the same dimensions. Steps to reproduce Minimal malicious BDF file (270 bytes): Proof of Concept script: Expected output: Amplified attack (multiple glyphs): A BDF…

    Recommended action: Upgrade to 12.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. High, CVSS 7.5PyPIAmendedPublished

    Pillow: FontFile.compile(): Image.new() called without _decompression_bomb_check()

    CVE-2026-54060 · GHSA-5x94-69rx-g8h2

    Affected
    • PyPI pillow < 12.3.0
    Fixed in
    12.3.0· Vendor fix available
    Issue
    PIL/FontFile.py FontFile.compile() assembles per-glyph images into a single combined bitmap using Image.new("1", (xsize, ysize)) without calling Image.decompressionbombcheck(). This is the base-class method shared by both BdfFontFile and PcfFontFile, and it is triggered whenever a loaded font is converted to an ImageFont or saved. Neither BdfFontFile.BdfFontFile(fp) nor PcfFontFile.PcfFontFile(fp) is registered with Image.registeropen(), so Pillow's standard decompression bomb guard never fires for font objects. The compile step is the final opportunity to check the combined allocation — and it has no check. Vulnerable code (PIL/FontFile.py lines ~64–92): "Slow accumulation" attack — per-glyph dimensions stay BELOW warning threshold: | Metric | Per-glyph (800 × 875) | Combined bitmap (256 glyphs) | |---|---|---| | Pixel count | 700,000 | 179,200,000 | | DecompressionBombWarning threshold (89.4M) | 0.008× — no warning | 2.0× — above warning | | DecompressionBombError…

    Recommended action: Upgrade to 12.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. High, CVSS 7.5PyPIAmendedPublished

    Pillow PcfFontFile._load_bitmaps(): Image.frombytes() called without _decompression_bomb_check() — bomb protection bypass via PCF font loading

    CVE-2026-54059 · GHSA-8v84-f9pq-wr9x

    Affected
    • PyPI pillow < 12.3.0
    Fixed in
    12.3.0· Vendor fix available
    Issue
    PIL/PcfFontFile.py loadbitmaps() (line 227) reads glyph dimensions from the PCF METRICS section and passes them directly to Image.frombytes() without calling Image.decompressionbombcheck(). Dimensions originate from unsigned 16-bit values: Maximum exploitable pixel count: 65,535 × 131,070 = 8,589,734,450 pixels — 48× the DecompressionBombError threshold. Vulnerable code (PIL/PcfFontFile.py line 224–227): Image.frombytes() calls Image.new() first (allocating the full C-heap buffer), then attempts to fill it. This creates two distinct attack paths: - Persistent attack: Provide matching bitmap data → frombytes() succeeds → image stored in font.glyph[ch] permanently - Transient attack: Provide a 148-byte PCF file with large declared dimensions but no data → Image.new() allocates the full buffer → ValueError → buffer freed → but the spike occurs before Python can respond Steps to reproduce Proof of Concept script: Expected output: Amplification table: | PCF file | Glyph dims |…

    Recommended action: Upgrade to 12.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 8.3PyPIAmendedPublished

    Pillow: Out-of-bounds read via attacker-controlled row stride on Pillow's mmap path (McIdas AREA files)

    CVE-2026-54058 · GHSA-62p4-gmf7-7g93

    Affected
    • PyPI pillow < 12.3.0
    Fixed in
    12.3.0· Vendor fix available
    Issue
    When Pillow loads an uncompressed image whose tile uses the raw codec and a mode in Image.MAPMODES, and the image was opened from a filename, it memory-maps the file and builds the image's row pointers directly into the mapping via PyImagingMapBuffer (src/map.c). The per-row spacing (stride) is taken from the tile arguments. map.c validates offset + ysizestride <= bufferlen but never checks that stride is at least the natural row width xsize pixelsize. The McIdas AREA plugin (McIdasImagePlugin.py) derives stride, offset, xsize, and ysize directly from attacker-controlled 32-bit header words with no validation. By supplying a stride far smaller than the row width, an attacker makes each row pointer read xsizepixelsize bytes that run past the mapped region. Accessing the pixels (e.g. Image.tobytes(), getpixel, convert, save) then reads adjacent process memory (information disclosure) or faults (SIGBUS, denial of service). Complete Code Trace Step 1: McIdasImageFile.open - turns…

    Recommended action: Upgrade to 12.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. High, CVSS 8.6PyPIAmendedPublished

    Pillow has an OOB Write with Invalid PSD Tile Extents (Integer Overflow)

    CVE-2026-42311 · GHSA-pwv6-vv43-88gr

    Affected
    • PyPI pillow >= 10.3.0, < 12.2.0
    Fixed in
    12.2.0· Vendor fix available
    Issue
    Impact Processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution. Patches Patched version: 12.2.0 Pillow 12.1.1 addressed CVE-2026-25990 by adding checks for tile extents in PSD image decoding/encoding to prevent an out-of-bounds write. However, the bounds checks computed tile extent sums using types susceptible to integer overflow, meaning a PSD image with carefully chosen tile dimensions could produce values that wrap around and bypass the checks, still triggering an out-of-bounds write in src/decode.c and src/encode.c. The fix avoids adding extents together before comparison. Workarounds Use any version but affected versions: = 10.3.0, < 12.2.0 Resources - Fix: https://github.com/python-pillow/Pillow/pull/9520 - Original issue: CVE-2026-25990 (Pillow 12.1.1)

    Recommended action: Upgrade to 12.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. Medium, CVSS 5.1PyPIAmendedPublished

    Pillow has a PDF Parsing Trailer Infinite Loop (DoS)

    CVE-2026-42310 · GHSA-r73j-pqj5-w3x7

    Affected
    • PyPI pillow >= 4.2.0, < 12.2.0
    Fixed in
    12.2.0· Vendor fix available
    Issue
    Impact An attacker can supply a malicious PDF that causes the process to hang indefinitely, consuming 100% CPU and making the application unresponsive. Patches Patched version: 12.2.0. PdfParser (introduced in Pillow 4.2.0) follows Prev pointers in PDF trailers to read cross-reference sections. If a trailer's Prev pointer references an offset that has already been processed — either pointing to itself or forming a longer cycle — the parser enters an infinite loop. Pillow now tracks previously processed trailer offsets and raises an error if a cycle is detected. Workarounds Use any version but the affected versions: = 4.2.0, < 12.2.0 Resources - Fix: https://github.com/python-pillow/Pillow/pull/9519

    Recommended action: Upgrade to 12.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  7. Medium, CVSS 5.1PyPIAmendedPublished

    Pillow has an integer overflow when processing fonts

    CVE-2026-42308 · GHSA-wjx4-4jcj-g98j

    Affected
    • PyPI pillow < 12.2.0
    Fixed in
    12.2.0· Vendor fix available
    Issue
    If a font advances for each glyph by an exceeding large amount, when Pillow keeps track of the current position, it may lead to an integer overflow. This has been fixed.

    Recommended action: Upgrade to 12.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  8. Medium, CVSS 5.1PyPIAmendedPublished

    Pillow has a heap buffer overflow with nested list coordinates

    CVE-2026-42309 · GHSA-5xmw-vc9v-4wf2

    Affected
    • PyPI pillow >= 11.2.1, < 12.2.0
    Fixed in
    12.2.0· Vendor fix available
    Issue
    Passing nested lists as coordinates to APIs that accept coordinates such as ImagePath.Path, ImageDraw.ImageDraw.polygon and ImageDraw.ImageDraw.line could cause a heap buffer overflow, as nested lists were recursively unpacked beyond the allocated buffer. Coordinate lists are now validated to contain exactly two numeric coordinates. This was introduced in Pillow 11.2.1.

    Recommended action: Upgrade to 12.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  9. High, CVSS 8.7PyPIAmendedPublished

    FITS GZIP decompression bomb in Pillow

    CVE-2026-40192 · GHSA-whj4-6x5x-4v2j

    Affected
    • PyPI pillow >= 10.3.0, < 12.2.0
    Fixed in
    12.2.0· Vendor fix available
    Issue
    Impact Pillow did not limit the amount of GZIP-compressed data read when decoding a FITS image, making it vulnerable to decompression bomb attacks. A specially crafted FITS file could cause unbounded memory consumption, leading to denial of service (OOM crash or severe performance degradation). Patches The amount of data read is now limited to the necessary amount. Fixed in Pillow 12.2.0 (PR #9521). Workarounds Avoid Pillow = 10.3.0, < 12.2.0 Only open specific image formats, excluding FITS.

    Recommended action: Upgrade to 12.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  10. High, CVSS 8.6PyPIAmendedPublished

    Pillow affected by out-of-bounds write when loading PSD images

    CVE-2026-25990 · GHSA-cfh3-3jmp-rvhc

    Affected
    • PyPI pillow >= 10.3.0, < 12.1.1
    Fixed in
    12.1.1· Vendor fix available
    Issue
    Impact An out-of-bounds write may be triggered when loading a specially crafted PSD image. Pillow = 10.3.0 users are affected. Patches Pillow 12.1.1 will be released shortly with a fix for this. Workarounds Image.open() has a formats parameter that can be used to prevent PSD images from being opened. References Pillow 12.1.1 will add release notes at https://pillow.readthedocs.io/en/stable/releasenotes/index.html

    Recommended action: Upgrade to 12.1.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  11. High, CVSS 7.1PyPIAmendedPublished

    Pillow vulnerability can cause write buffer overflow on BCn encoding

    CVE-2025-48379 · GHSA-xg8h-j46f-w952

    Affected
    • PyPI pillow >= 11.2.0, < 11.3.0
    Fixed in
    11.3.0· Vendor fix available
    Issue
    There is a heap buffer overflow when writing a sufficiently large (64k encoded with default settings) image in the DDS format due to writing into a buffer without checking for available space. This only affects users who save untrusted data as a compressed DDS image. Unclear how large the potential write could be. It is likely limited by process segfault, so it's not necessarily deterministic. It may be practically unbounded. Unclear if there's a restriction on the bytes that could be emitted. It's likely that the only restriction is that the bytes would be emitted in chunks of 8 or 16. This was introduced in Pillow 11.2.0 when the feature was added.

    Recommended action: Upgrade to 11.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  12. High, CVSS 7.3PyPIAmendedPublished

    Pillow buffer overflow vulnerability

    CVE-2024-28219 · GHSA-44wm-f244-xhp3

    Affected
    • PyPI pillow < 10.3.0
    Fixed in
    10.3.0· Vendor fix available
    Issue
    In imagingcms.c in Pillow before 10.3.0, a buffer overflow exists because strcpy is used instead of strncpy.

    Recommended action: Upgrade to 10.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  13. Critical, CVSS 9.3PyPIAmendedPublished

    Arbitrary Code Execution in Pillow

    CVE-2023-50447 · GHSA-3f63-hfp8-52jq

    Affected
    • PyPI pillow < 10.2.0
    Fixed in
    10.2.0· Vendor fix available
    Issue
    Pillow through 10.1.0 allows PIL.ImageMath.eval Arbitrary Code Execution via the environment parameter, a different vulnerability than CVE-2022-22817 (which was about the expression parameter).

    Recommended action: Upgrade to 10.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  14. High, CVSS 8.7PyPIAmendedPublished

    Pillow Denial of Service vulnerability

    CVE-2023-44271 · GHSA-8ghj-p4vj-mr35

    Affected
    • PyPI pillow < 10.0.0
    Fixed in
    10.0.0· Vendor fix available
    Issue
    An issue was discovered in Pillow before 10.0.0. It is a Denial of Service that uncontrollably allocates memory to process a given task, potentially causing a service to crash by having it run out of memory. This occurs for truetype in ImageFont when textlength in an ImageDraw instance operates on a long text argument.

    Recommended action: Upgrade to 10.0.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  15. UnratedPyPIPublished

    PYSEC-2023-175

    Affected
    • PyPI pillow < 10.0.1
    Fixed in
    10.0.1· Vendor fix available
    Issue
    Pillow versions before v10.0.1 bundled libwebp binaries in wheels that are vulnerable to CVE-2023-5129 (previously CVE-2023-4863). Pillow v10.0.1 upgrades the bundled libwebp binary to v1.3.2.

    Recommended action: Upgrade to 10.0.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.devSource checked Evidence →
  16. High, CVSS 8.8Exploited · CISA KEVPyPIAmendedPublished

    libwebp: OOB write in BuildHuffmanTable

    CVE-2023-4863 · GHSA-j7hp-h8jx-5ppr

    Affected
    • PyPI pillow < 10.0.1
    Fixed in
    10.0.1· Vendor fix available
    Issue
    Heap buffer overflow in libwebp allow a remote attacker to perform an out of bounds memory write via a crafted HTML page.

    Recommended action: Upgrade to 10.0.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)cisa.gov (2)cisa.gov (3)github.com (4)Source checked Evidence →
  17. High, CVSS 8.7PyPIAmendedPublished

    Pillow vulnerable to Data Amplification attack.

    CVE-2022-45198 · GHSA-m2vv-5vj5-2hm7

    Affected
    • PyPI pillow < 9.2.0
    Fixed in
    9.2.0· Vendor fix available
    Issue
    Pillow before 9.2.0 performs Improper Handling of Highly Compressed GIF Data (Data Amplification).

    Recommended action: Upgrade to 9.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  18. High, CVSS 8.7PyPIAmendedPublished

    Pillow subject to DoS via SAMPLESPERPIXEL tag

    CVE-2022-45199 · GHSA-q4mp-jvh2-76fj

    Affected
    • PyPI pillow >= 9.2.0, < 9.3.0
    Fixed in
    9.3.0· Vendor fix available
    Issue
    Pillow starting with 9.2.0 and prior to 9.3.0 allows denial of service via SAMPLESPERPIXEL. A large value in the SAMPLESPERPIXEL tag could lead to a memory and runtime DOS in TiffImagePlugin.py when setting up the context for image decoding. This issue has been patched in version 9.3.0.

    Recommended action: Upgrade to 9.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  19. High, CVSS 8.7PyPIAmendedPublished

    Buffer over-flow in Pillow

    CVE-2022-30595 · GHSA-hr8g-f6r6-mr22

    Affected
    • PyPI pillow >= 9.1.0, <= 9.1.0
    Fixed in
    9.1.1· Vendor fix available
    Issue
    When reading a TGA file with RLE packets that cross scan lines, Pillow reads the information past the end of the first line without deducting that from the length of the remaining file data. This vulnerability was introduced in Pillow 9.1.0, and can cause a heap buffer overflow. Opening an image with a zero or negative height has been found to bypass a decompression bomb check. This will now raise a SyntaxError instead, in turn raising a PIL.UnidentifiedImageError.

    Recommended action: Upgrade to 9.1.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  20. Critical, CVSS 9.3PyPIAmendedPublished

    Buffer Copy without Checking Size of Input in Pillow

    CVE-2020-5311 · GHSA-r7rm-8j6h-r933

    Affected
    • PyPI pillow <= 6.2.1
    Fixed in
    6.2.2· Vendor fix available
    Issue
    libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.

    Recommended action: Upgrade to 6.2.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  21. Critical, CVSS 9.3PyPIAmendedPublished

    Pillow command injection

    CVE-2014-3007 · GHSA-8m9x-pxwq-j236

    Affected
    • PyPI pillow < 2.5.0
    Fixed in
    2.5.0· Vendor fix available
    Issue
    Python Image Library (PIL) 1.1.7 and earlier and Pillow before 2.5.0 might allow remote attackers to execute arbitrary commands via shell metacharacters in unspecified vectors related to CVE-2014-1932, possibly JpegImagePlugin.py.

    Recommended action: Upgrade to 2.5.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  22. High, CVSS 7.1PyPIAmendedPublished

    Pillow Buffer overflow in Jpeg2KEncode.c

    CVE-2016-3076 · GHSA-v9pc-9mvp-x87g

    Affected
    • PyPI pillow >= 2.5.0, < 3.1.2
    Fixed in
    3.1.2· Vendor fix available
    Issue
    Heap-based buffer overflow in the j2kencodeentry function in Pillow 2.5.0 through 3.1.1 allows remote attackers to cause a denial of service (memory corruption) via a crafted Jpeg2000 file.

    Recommended action: Upgrade to 3.1.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  23. High, CVSS 8.5PyPIAmendedPublished

    PIL and Pillow Vulnerable to Symlink Attack on Tmpfiles

    CVE-2014-1932 · GHSA-x895-2wrm-hvp7

    Affected
    • PyPI pillow < 2.3.1
    Fixed in
    2.3.1· Vendor fix available
    Issue
    The (1) loaddjpeg function in JpegImagePlugin.py, (2) Ghostscript function in EpsImagePlugin.py, (3) load function in IptcImagePlugin.py, and (4) copy function in Image.py in Python Image Library (PIL) 1.1.7 and earlier and Pillow before 2.3.1 do not properly create temporary files, which allow local users to overwrite arbitrary files and obtain sensitive information via a symlink attack on the temporary file.

    Recommended action: Upgrade to 2.3.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  24. High, CVSS 8.7PyPIAmendedPublished

    Pillow denial of service via PNG bomb

    CVE-2014-9601 · GHSA-h5rf-vgqx-wjv2

    Affected
    • PyPI pillow < 2.7.0
    Fixed in
    2.7.0· Vendor fix available
    Issue
    Pillow before 2.7.0 allows remote attackers to cause a denial of service via a compressed text chunk in a PNG image that has a large size when it is decompressed.

    Recommended action: Upgrade to 2.7.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  25. High, CVSS 8.7PyPIAmendedPublished

    Pillow denial of service via Crafted Block Size

    CVE-2014-3589 · GHSA-cfmr-38g9-f2h7

    Affected
    • PyPI pillow < 2.3.2; >= 2.5, < 2.5.2
    Fixed in
    2.5.22.3.2· Vendor fix available
    Issue
    PIL/IcnsImagePlugin.py in Python Imaging Library (PIL) and Pillow before 2.3.2 and 2.5.x before 2.5.2 allows remote attackers to cause a denial of service via a crafted block size.

    Recommended action: Upgrade to 2.5.2 or 2.3.2 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →