Python Pillow vulnerabilities
115 known vulnerabilities affecting python/pillow.
Total CVEs
115
CISA KEV
1
actively exploited
Public exploits
1
Exploited in wild
2
Severity breakdown
CRITICAL17HIGH64MEDIUM33LOW1
Vulnerabilities
Page 4 of 6
CVE-2021-28677P3HIGHCVSS 7.5fixed in 8.2.02021-06-02
CVE-2021-28677 [HIGH] CVE-2021-28677: An issue was discovered in Pillow before 8.2.0. For EPS data, the readline implementation used in EP
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
ghsanvdosv
CVE-2026-112401P3HIGHCVSS 7.5≥ 5.4.0, < 13.0.02026-10-21
CVE-2026-112401 [HIGH] CWE-407 Pillow: Quadratic GIF comment concatenation allows DoS in Image.open()
Pillow: Quadratic GIF comment concatenation allows DoS in Image.open()
```
Quadratic GIF comment concatenation allows DoS in Image.open()
Location: src/PIL/GifImagePlugin.py:266 in GifImageFile._seek()
Commit: a707c6b21c313880d0771e54965d142dd42358b6
```
Opening a crafted GIF file with `Image.open()` takes time that grows with the square of the file's size, so anyone who can submit an image to
ghsa
CVE-2026-112891P3MEDIUM≥ 9.2.0, < 13.0.02026-10-21
CVE-2026-112891 [MEDIUM] CWE-407 Pillow: Quadratic GIF comment copying during save
Pillow: Quadratic GIF comment copying during save
On Pillow 12.3.0 and upstream `main` (`ad277e2761b489681e71b51e91367d46b0ceabb9`), a GIF with a long comment makes `_get_global_header()` copy portions of the comment repeatedly when saving, including comments carried over from untrusted images. I suggest provisional **Moderate** severity for crafted-image CPU denial of service, with CVSS-B 6.9 assuming a network
ghsa
CVE-2021-28676P3HIGHCVSS 7.5fixed in 8.2.02021-06-02
CVE-2021-28676 [HIGH] CWE-835 CVE-2021-28676: An issue was discovered in Pillow before 8.2.0. For FLI data, FliDecode did not properly check that
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.
ghsanvdosv
CVE-2026-114501P3MEDIUM≥ 11.2.1, < 13.0.02026-10-23
CVE-2026-114501 [MEDIUM] CWE-226 Pillow: Arrow export leaks stale heap memory when PILLOW_ALIGNMENT > 1
Pillow: Arrow export leaks stale heap memory when PILLOW_ALIGNMENT > 1
### Summary
When [`PILLOW_ALIGNMENT`](https://pillow.readthedocs.io/en/stable/reference/block_allocator.html#memory-pools) is set above 1, exporting an image to Arrow returns uninitialized heap memory mixed in with the pixel data. That memory can include pixels from images the process freed earlier.
### Details
With an
ghsa
CVE-2026-112898P3MEDIUM≥ 9.1.0, < 13.0.02026-10-21
CVE-2026-112898 [MEDIUM] CWE-457 Pillow: Image.quantize() with empty palette leaks uninitialized stack memory
Pillow: Image.quantize() with empty palette leaks uninitialized stack memory
```
Image.quantize() with empty palette leaks uninitialized stack memory
Location: src/libImaging/Palette.c:216 in ImagingPaletteCacheUpdate()
Commit: a707c6b21c313880d0771e54965d142dd42358b6
```
When an application lets a user supply the palette image for Pillow's `Image.quantize(palette=...)`, the user can g
ghsa
CVE-2021-27922P3HIGHCVSS 7.5fixed in 8.1.12021-03-03
CVE-2021-27922 [HIGH] CWE-20 CVE-2021-27922: Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the r
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.
ghsanvdosv
CVE-2021-23437P3HIGHCVSS 7.5≥ 5.2.0, < 8.3.2fixed in unspecified+1 more2021-09-03
CVE-2021-23437 [HIGH] CWE-125 CVE-2021-23437: The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (Re
The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb function.
ghsanvdosv
CVE-2021-25293P3HIGHCVSS 7.5fixed in 8.1.12021-03-19
CVE-2021-25293 [HIGH] CWE-125 CVE-2021-25293: An issue was discovered in Pillow before 8.1.1. There is an out-of-bounds read in SGIRleDecode.c.
An issue was discovered in Pillow before 8.1.1. There is an out-of-bounds read in SGIRleDecode.c.
ghsanvdosv
CVE-2022-45198P3HIGHCVSS 7.5fixed in 9.2.02022-11-14
CVE-2022-45198 [HIGH] CVE-2022-45198: Pillow before 9.2.0 performs Improper Handling of Highly Compressed GIF Data (Data Amplification).
Pillow before 9.2.0 performs Improper Handling of Highly Compressed GIF Data (Data Amplification).
ghsanvdosv
CVE-2026-112901P3MEDIUM≥ 0, < 13.0.02026-10-21
CVE-2026-112901 [MEDIUM] CWE-1333 Pillow: ReDoS in XbmImagePlugin: 512-byte file stalls Image.open() for minutes
Pillow: ReDoS in XbmImagePlugin: 512-byte file stalls Image.open() for minutes
```
ReDoS in XbmImagePlugin: 512-byte file stalls Image.open() for minutes
Location: src/PIL/XbmImagePlugin.py:58 in XbmImageFile._open()
Commit: a707c6b21c313880d0771e54965d142dd42358b6
```
A crafted 512-byte file makes Pillow's `Image.open()` spend about six minutes of processor time on one core before
ghsa
CVE-2021-27921P3HIGHCVSS 7.5fixed in 8.1.12021-03-03
CVE-2021-27921 [HIGH] CWE-20 CVE-2021-27921: Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the r
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.
ghsanvdosv
CVE-2021-27923P3HIGHCVSS 7.5fixed in 8.1.12021-03-03
CVE-2021-27923 [HIGH] CWE-20 CVE-2021-27923: Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the r
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.
ghsanvdosv
CVE-2021-25290P3HIGHCVSS 7.5fixed in 8.1.12021-03-19
CVE-2021-25290 [HIGH] CWE-787 CVE-2021-25290: An issue was discovered in Pillow before 8.1.1. In TiffDecode.c, there is a negative-offset memcpy w
An issue was discovered in Pillow before 8.1.1. In TiffDecode.c, there is a negative-offset memcpy with an invalid size.
ghsanvdosv
CVE-2019-19911P3HIGHCVSS 7.5fixed in 6.2.22020-01-05
CVE-2019-19911 [HIGH] CWE-190 CVE-2019-19911: There is a DoS vulnerability in Pillow before 6.2.2 caused by FpxImagePlugin.py calling the range fu
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 t
ghsanvdosv
CVE-2021-25291P3HIGHCVSS 7.5fixed in 8.1.12021-03-19
CVE-2021-25291 [HIGH] CWE-125 CVE-2021-25291: An issue was discovered in Pillow before 8.1.1. In TiffDecode.c, there is an out-of-bounds read in T
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.
ghsanvdosv
CVE-2023-44271P3HIGHCVSS 7.5fixed in 10.0.02023-11-03
CVE-2023-44271 [HIGH] CWE-770 CVE-2023-44271: An issue was discovered in Pillow before 10.0.0. It is a Denial of Service that uncontrollably alloc
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.
ghsanvdosv
CVE-2026-96643P3HIGH≥ 11.0.0, < 13.0.02026-10-22
CVE-2026-96643 [HIGH] CWE-407 Pillow: PNG eXIf chunk makes EXIF parsing run in quadratic time
Pillow: PNG eXIf chunk makes EXIF parsing run in quadratic time
### Summary
A PNG file with a large eXIf chunk full of repeated 6-byte markers makes Pillow's EXIF parser take seconds of CPU instead of milliseconds. The cost grows with the square of the chunk size, so a normal small-photo-sized file is enough to cause real delay.
### Details
`Exif.load()` in `src/PIL/Image.py` strips a marker from the
ghsa
CVE-2026-96644P3HIGH≥ 0, < 13.0.02026-10-22
CVE-2026-96644 [HIGH] CWE-125 Pillow: Heap over-read in WMF/EMF rendering via 16-bit dimension truncation (Windows builds)
Pillow: Heap over-read in WMF/EMF rendering via 16-bit dimension truncation (Windows builds)
### Summary
On Windows builds, Pillow stores EMF and WMF image dimensions without a range check and passes them to the native `drawwmf` handler. That code sizes its allocation from dimensions truncated into 16-bit header fields but copies the result using the full 32-bit dimensions.
ghsa
CVE-2020-10379P4HIGHCVSS 7.8fixed in 7.1.02020-06-25
CVE-2020-10379 [HIGH] CWE-120 CVE-2020-10379: In Pillow before 7.1.0, there are two Buffer Overflows in libImaging/TiffDecode.c.
In Pillow before 7.1.0, there are two Buffer Overflows in libImaging/TiffDecode.c.
ghsanvdosv