Pillow Python Pillow

Don't miss out!

Thousands of developers use stack.watch to stay informed.
Get an email whenever new security vulnerabilities are reported in Python Pillow.

By the Year

In 2026 there have been 1 vulnerability in Python Pillow. Pillow did not have any published security vulnerabilities last year. That is, 1 more vulnerability have already been reported in 2026 as compared to last year.




Year Vulnerabilities Average Score
2026 1 0.00
2025 0 0.00
2024 2 7.40
2023 1 7.50
2022 7 8.10
2021 19 7.58
2020 10 7.76
2019 1 0.00

It may take a day or so for new Pillow vulnerabilities to show up in the stats or in the list of recent security vulnerabilities. Additionally vulnerabilities may be tagged under a different product or component name.

Recent Python Pillow Security Vulnerabilities

Pillow 10.312.1.1: OOB Write PSD Image Load (Fixed 12.1.1)
CVE-2026-25990 - February 11, 2026

Pillow is a Python imaging library. From 10.3.0 to before 12.1.1, n out-of-bounds write may be triggered when loading a specially crafted PSD image. This vulnerability is fixed in 12.1.1.

Memory Corruption

Pillow 10.2.0 Buffer Overflow in _imagingcms.c via strcpy
CVE-2024-28219 6.7 - Medium - April 03, 2024

In _imagingcms.c in Pillow before 10.3.0, a buffer overflow exists because strcpy is used instead of strncpy.

Integer Overflow to Buffer Overflow

Pillow <=10.1.0 PIL.ImageMath.eval Arbitrary Code Exec via env
CVE-2023-50447 8.1 - High - January 19, 2024

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).

Code Injection

Pillow <10.0.0 - DOS via memory overallocation in ImageFont Truetype
CVE-2023-44271 7.5 - High - November 03, 2023

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.

Allocation of Resources Without Limits or Throttling

Pillow <9.2.0 GIF Data Amplification Vulnerability
CVE-2022-45198 7.5 - High - November 14, 2022

Pillow before 9.2.0 performs Improper Handling of Highly Compressed GIF Data (Data Amplification).

Pillow <9.3.0 DoS via SAMPLESPERPIXEL
CVE-2022-45199 7.5 - High - November 14, 2022

Pillow before 9.3.0 allows denial of service via SAMPLESPERPIXEL.

Resource Exhaustion

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files.
CVE-2022-30595 9.8 - Critical - May 25, 2022

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files.

Memory Corruption

Pillow before 9.0.1
CVE-2022-24303 9.1 - Critical - March 28, 2022

Pillow before 9.0.1 allows attackers to delete files because spaces in temporary pathnames are mishandled.

path_getbbox in path.c in Pillow before 9.0.0 improperly initializes ImagePath.Path.
CVE-2022-22815 6.5 - Medium - January 10, 2022

path_getbbox in path.c in Pillow before 9.0.0 improperly initializes ImagePath.Path.

Improper Initialization

path_getbbox in path.c in Pillow before 9.0.0 has a buffer over-read during initialization of ImagePath.Path.
CVE-2022-22816 6.5 - Medium - January 10, 2022

path_getbbox in path.c in Pillow before 9.0.0 has a buffer over-read during initialization of ImagePath.Path.

Out-of-bounds Read

PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method
CVE-2022-22817 9.8 - Critical - January 10, 2022

PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method. A lambda expression could also be used.

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS)
CVE-2021-23437 7.5 - High - September 03, 2021

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb function.

Out-of-bounds Read

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7
CVE-2021-34552 9.8 - Critical - July 13, 2021

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters directly into a convert function to trigger a buffer overflow in Convert.c.

Classic Buffer Overflow

An issue was discovered in Pillow before 8.2.0
CVE-2021-28678 5.5 - Medium - June 02, 2021

An issue was discovered in Pillow before 8.2.0. For BLP data, BlpImagePlugin did not properly check that reads (after jumping to file offsets) returned data. This could lead to a DoS where the decoder could be run a large number of times on empty data.

Insufficient Verification of Data Authenticity

An issue was discovered in Pillow before 8.2.0
CVE-2021-28677 7.5 - High - June 02, 2021

An issue was discovered in Pillow before 8.2.0. For EPS data, the readline implementation used in EPSImageFile has to deal with any combination of \r and \n as line endings. It used an accidentally quadratic method of accumulating lines while looking for a line ending. A malicious EPS file could use this to perform a DoS of Pillow in the open phase, before an image was accepted for opening.

An issue was discovered in Pillow before 8.2.0
CVE-2021-28676 7.5 - High - June 02, 2021

An issue was discovered in Pillow before 8.2.0. For FLI data, FliDecode did not properly check that the block advance was non-zero, potentially leading to an infinite loop on load.

Infinite Loop

An issue was discovered in Pillow before 8.2.0
CVE-2021-25287 9.1 - Critical - June 02, 2021

An issue was discovered in Pillow before 8.2.0. There is an out-of-bounds read in J2kDecode, in j2ku_graya_la.

Out-of-bounds Read

An issue was discovered in Pillow before 8.2.0
CVE-2021-25288 9.1 - Critical - June 02, 2021

An issue was discovered in Pillow before 8.2.0. There is an out-of-bounds read in J2kDecode, in j2ku_gray_i.

Out-of-bounds Read

An issue was discovered in Pillow before 8.2.0
CVE-2021-28675 5.5 - Medium - June 02, 2021

An issue was discovered in Pillow before 8.2.0. PSDImagePlugin.PsdImageFile lacked a sanity check on the number of input layers relative to the size of the data block. This could lead to a DoS on Image.open prior to Image.load.

Unchecked Return Value

An issue was discovered in Pillow before 8.1.1
CVE-2021-25289 9.8 - Critical - March 19, 2021

An issue was discovered in Pillow before 8.1.1. TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files because of certain interpretation conflicts with LibTIFF in RGBA mode. NOTE: this issue exists because of an incomplete fix for CVE-2020-35654.

Memory Corruption

An issue was discovered in Pillow before 8.1.1
CVE-2021-25290 7.5 - High - March 19, 2021

An issue was discovered in Pillow before 8.1.1. In TiffDecode.c, there is a negative-offset memcpy with an invalid size.

Memory Corruption

An issue was discovered in Pillow before 8.1.1
CVE-2021-25291 7.5 - High - March 19, 2021

An issue was discovered in Pillow before 8.1.1. In TiffDecode.c, there is an out-of-bounds read in TiffreadRGBATile via invalid tile boundaries.

Out-of-bounds Read

An issue was discovered in Pillow before 8.1.1
CVE-2021-25292 6.5 - Medium - March 19, 2021

An issue was discovered in Pillow before 8.1.1. The PDF parser allows a regular expression DoS (ReDoS) attack via a crafted PDF file because of a catastrophic backtracking regex.

ReDoS

An issue was discovered in Pillow before 8.1.1
CVE-2021-25293 7.5 - High - March 19, 2021

An issue was discovered in Pillow before 8.1.1. There is an out-of-bounds read in SGIRleDecode.c.

Out-of-bounds Read

Pillow before 8.1.2
CVE-2021-27922 7.5 - High - March 03, 2021

Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is not properly checked for an ICNS container, and thus an attempted memory allocation can be very large.

Improper Input Validation

Pillow before 8.1.2
CVE-2021-27923 7.5 - High - March 03, 2021

Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is not properly checked for an ICO container, and thus an attempted memory allocation can be very large.

Improper Input Validation

Pillow before 8.1.2
CVE-2021-27921 7.5 - High - March 03, 2021

Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is not properly checked for a BLP container, and thus an attempted memory allocation can be very large.

Improper Input Validation

In Pillow before 8.1.0, SGIRleDecode has a 4-byte buffer over-read when decoding crafted SGI RLE image files
CVE-2020-35655 5.4 - Medium - January 12, 2021

In Pillow before 8.1.0, SGIRleDecode has a 4-byte buffer over-read when decoding crafted SGI RLE image files because offsets and length tables are mishandled.

Out-of-bounds Read

In Pillow before 8.1.0, TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files
CVE-2020-35654 8.8 - High - January 12, 2021

In Pillow before 8.1.0, TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files because of certain interpretation conflicts with LibTIFF in RGBA mode.

Memory Corruption

In Pillow before 8.1.0, PcxDecode has a buffer over-read when decoding a crafted PCX file
CVE-2020-35653 7.1 - High - January 12, 2021

In Pillow before 8.1.0, PcxDecode has a buffer over-read when decoding a crafted PCX file because the user-supplied stride value is trusted for buffer calculations.

Out-of-bounds Read

In libImaging/SgiRleDecode.c in Pillow through 7.0.0
CVE-2020-11538 - June 25, 2020

In libImaging/SgiRleDecode.c in Pillow through 7.0.0, a number of out-of-bounds reads exist in the parsing of SGI image files, a different issue than CVE-2020-5311.

In libImaging/Jpeg2KDecode.c in Pillow before 7.1.0, there are multiple out-of-bounds reads
CVE-2020-10994 - June 25, 2020

In libImaging/Jpeg2KDecode.c in Pillow before 7.1.0, there are multiple out-of-bounds reads via a crafted JP2 file.

In Pillow before 7.1.0
CVE-2020-10379 7.8 - High - June 25, 2020

In Pillow before 7.1.0, there are two Buffer Overflows in libImaging/TiffDecode.c.

Classic Buffer Overflow

In libImaging/PcxDecode.c in Pillow before 7.1.0, an out-of-bounds read
CVE-2020-10378 5.5 - Medium - June 25, 2020

In libImaging/PcxDecode.c in Pillow before 7.1.0, an out-of-bounds read can occur when reading PCX files where state->shuffle is instructed to read beyond state->buffer.

Out-of-bounds Read

Pillow before 7.1.0 has multiple out-of-bounds reads in libImaging/FliDecode.c.
CVE-2020-10177 5.5 - Medium - June 25, 2020

Pillow before 7.1.0 has multiple out-of-bounds reads in libImaging/FliDecode.c.

Out-of-bounds Read

There is a DoS vulnerability in Pillow before 6.2.2 caused by FpxImagePlugin.py calling the range function on an unvalidated 32-bit integer if the number of bands is large
CVE-2019-19911 - January 05, 2020

There is a DoS vulnerability in Pillow before 6.2.2 caused by FpxImagePlugin.py calling the range function on an unvalidated 32-bit integer if the number of bands is large. On Windows running 32-bit Python, this results in an OverflowError or MemoryError due to the 2 GB limit. However, on Linux running 64-bit Python this results in the process being terminated by the OOM killer.

libImaging/TiffDecode.c in Pillow before 6.2.2 has a TIFF decoding integer overflow
CVE-2020-5310 8.8 - High - January 03, 2020

libImaging/TiffDecode.c in Pillow before 6.2.2 has a TIFF decoding integer overflow, related to realloc.

Integer Overflow or Wraparound

libImaging/FliDecode.c in Pillow before 6.2.2 has an FLI buffer overflow.
CVE-2020-5313 7.1 - High - January 03, 2020

libImaging/FliDecode.c in Pillow before 6.2.2 has an FLI buffer overflow.

Out-of-bounds Read

libImaging/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow.
CVE-2020-5312 9.8 - Critical - January 03, 2020

libImaging/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow.

Classic Buffer Overflow

libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.
CVE-2020-5311 9.8 - Critical - January 03, 2020

libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.

Classic Buffer Overflow

An issue was discovered in Pillow before 6.2.0
CVE-2019-16865 - October 04, 2019

An issue was discovered in Pillow before 6.2.0. When reading specially crafted invalid image files, the library can either allocate very large amounts of memory or take an extremely long period of time to process the image.

Stay on top of Security Vulnerabilities

Want an email whenever new vulnerabilities are published for Python Pillow or by Python? Click the Watch button to subscribe.

Python
Vendor

Python Pillow
Product

subscribe