Every CVE Search/ Get API key

CVE-2021-25291

Out of bounds read in Pillow

7.5 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

1.40%Up 1.0 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 7.5

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.

Record
CVE-2021-25291
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-125
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-25291
Updated
2026-11-02
EUVDEUVD-2021-0174 No score

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.

Record
EUVD-2021-0174
Updated
2026-11-03
GitHub AdvisoriesGHSA-mvg9-xffr-p774 8.7

Out of bounds read in Pillow

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

Record
GHSA-mvg9-xffr-p774
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
OSVALPINE-CVE-2021-25291 7.5

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.

Record
ALPINE-CVE-2021-25291
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
OSV 7.5

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.

Record
CVE-2021-25291
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 11 moreShow less
OSVDEBIAN-CVE-2021-25291 7.5

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.

Record
DEBIAN-CVE-2021-25291
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-mvg9-xffr-p774 8.7

Out of bounds read in Pillow

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

Record
GHSA-mvg9-xffr-p774
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
OSVUBUNTU-CVE-2021-25291 7.5

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.

Record
UBUNTU-CVE-2021-25291
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVBIT-pillow-2021-25291 No score

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.

Record
BIT-pillow-2021-25291
Updated
2026-11-02
OSVopenSUSE-SU-2021:1134-1 No score

Security update for python-CairoSVG, python-Pillow

This update for python-CairoSVG, python-Pillow fixes the following issues:

Update to version 2.5.1.

  • Security fix: When processing SVG files, CairoSVG was using two regular expressions which are vulnerable to Regular Expression Denial of Service (REDoS). If an attacker provided a malicious SVG, it could make CairoSVG get stuck processing the file for a very long time.
  • Fix marker positions for unclosed paths
  • Follow hint when only output_width or output_height is set
  • Handle opacity on raster images
  • Don’t crash when use tags reference unknown tags
  • Take care of the next letter when A/a is replaced by l
  • Fix misalignment in node.vertices

Updates for version 2.5.0.

  • Drop support of Python 3.5, add support of Python 3.9.
  • Add EPS export
  • Add background-color, negate-colors, and invert-images options
  • Improve support for font weights
  • Fix opacity of patterns and gradients
  • Support auto-start-reverse value for orient
  • Draw images contained in defs
  • Add Exif transposition support
  • Handle dominant-baseline
  • Support transform-origin

python-Pillow update to version 8.3.1:

  • Catch OSError when checking if fp is sys.stdout #5585 [radarhere]

  • Handle removing orientation from alternate types of EXIF data #5584 [radarhere]

  • Make Image.array take optional dtype argument #5572 [t-vi, radarhere]

  • Use snprintf instead of sprintf. CVE-2021-34552 #5567 [radarhere]

  • Limit TIFF strip size when saving with LibTIFF #5514 [kmilos]

  • Allow ICNS save on all operating systems #4526 [baletu, radarhere, newpanjing, hugovk]

  • De-zigzag JPEG's DQT when loading; deprecate convert_dict_qtables #4989 [gofr, radarhere]

  • Replaced xml.etree.ElementTree #5565 [radarhere]

  • Moved CVE image to pillow-depends #5561 [radarhere]

  • Added tag data for IFD groups #5554 [radarhere]

  • Improved ImagePalette #5552 [radarhere]

  • Add DDS saving #5402 [radarhere]

  • Improved getxmp() #5455 [radarhere]

  • Convert to float for comparison with float in IFDRational eq #5412 [radarhere]

  • Allow getexif() to access TIFF tag_v2 data #5416 [radarhere]

  • Read FITS image mode and size #5405 [radarhere]

  • Merge parallel horizontal edges in ImagingDrawPolygon #5347 [radarhere, hrdrq]

  • Use transparency behind first GIF frame and when disposing to background #5557 [radarhere, zewt]

  • Avoid unstable nature of qsort in Quant.c #5367 [radarhere]

  • Copy palette to new images in ImageOps expand #5551 [radarhere]

  • Ensure palette string matches RGB mode #5549 [radarhere]

  • Do not modify EXIF of original image instance in exif_transpose() #5547 [radarhere]

  • Fixed default numresolution for small JPEG2000 images #5540 [radarhere]

  • Added DDS BC5 reading #5501 [radarhere]

  • Raise an error if ImageDraw.textbbox is used without a TrueType font #5510 [radarhere]

  • Added ICO saving in BMP format #5513 [radarhere]

  • Ensure PNG seeks to end of previous chunk at start of load_end #5493 [radarhere]

  • Do not allow TIFF to seek to a past frame #5473 [radarhere]

  • Avoid race condition when displaying images with eog #5507 [mconst]

  • Added specific error messages when ink has incorrect number of bands #5504 [radarhere]

  • Allow converting an image to a numpy array to raise errors #5379 [radarhere]

  • Removed DPI rounding from BMP, JPEG, PNG and WMF loading #5476, #5470 [radarhere]

  • Remove spikes when drawing thin pieslices #5460 [xtsm]

  • Updated default value for SAMPLESPERPIXEL TIFF tag #5452 [radarhere]

  • Removed TIFF DPI rounding #5446 [radarhere, hugovk]

  • Include code in WebP error #5471 [radarhere]

  • Do not alter pixels outside mask when drawing text on an image with transparency #5434 [radarhere]

  • Reset handle when seeking backwards in TIFF #5443 [radarhere]

  • Replace sys.stdout with sys.stdout.buffer when saving #5437 [radarhere]

  • Fixed UNDEFINED TIFF tag of length 0 being changed in roundtrip #5426 [radarhere]

  • Fixed bug when checking FreeType2 version if it is not installed #5445 [radarhere]

  • Do not round dimensions…

Record
openSUSE-SU-2021:1134-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:11209-1 No score

python36-Pillow-8.3.2-1.2 on GA media

These are all security issues fixed in the python36-Pillow-8.3.2-1.2 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11209-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:13827-1 No score

python310-Pillow-10.3.0-1.1 on GA media

These are all security issues fixed in the python310-Pillow-10.3.0-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:13827-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:11261-1 No score

python313-Pillow-12.3.0-1.1 on GA media

These are all security issues fixed in the python313-Pillow-12.3.0-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11261-1
Updated
2026-11-02
OSVPYSEC-2021-37 No score

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.

Record
PYSEC-2021-37
Updated
2026-11-02
OSVROOT-APP-PYPI-CVE-2021-25291 No score

CVE-2021-25291 in pillow - Patched by Root

Root has patched CVE-2021-25291 in the pillow package for Root:PyPI. Multiple fixed versions available.

Record
ROOT-APP-PYPI-CVE-2021-25291
Updated
2026-11-05
OSVUSN-4763-1 No score

pillow vulnerabilities

It was discovered that Pillow incorrectly handled certain Tiff image files. If a user or automated system were tricked into opening a specially-crafted Tiff file, a remote attacker could cause Pillow to crash, resulting in a denial of service, or possibly execute arbitrary code. This issue only affected Ubuntu 20.04 LTS and Ubuntu 20.10. (CVE-2021-25289, CVE-2021-25291)

It was discovered that Pillow incorrectly handled certain Tiff image files. If a user or automated system were tricked into opening a specially-crafted Tiff file, a remote attacker could cause Pillow to crash, resulting in a denial of service, or possibly execute arbitrary code. (CVE-2021-25290)

It was discovered that Pillow incorrectly handled certain PDF files. If a user or automated system were tricked into opening a specially-crafted PDF file, a remote attacker could cause Pillow to hang, resulting in a denial of service. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, and Ubuntu 20.10. (CVE-2021-25292)

It was discovered that Pillow incorrectly handled certain SGI image files. If a user or automated system were tricked into opening a specially-crafted SGI file, a remote attacker could possibly cause Pillow to crash, resulting in a denial of service. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, and Ubuntu 20.10. (CVE-2021-25293)

Jiayi Lin, Luke Shaffer, Xinran Xie, and Akshay Ajayan discovered that Pillow incorrectly handled certain BLP files. If a user or automated system were tricked into opening a specially-crafted BLP file, a remote attacker could possibly cause Pillow to consume resources, resulting in a denial of service. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, and Ubuntu 20.10. (CVE-2021-27921)

Jiayi Lin, Luke Shaffer, Xinran Xie, and Akshay Ajayan discovered that Pillow incorrectly handled certain ICNS files. If a user or automated system were tricked into opening a specially-crafted ICNS file, a remote attacker could possibly cause Pillow to consume resources, resulting in a denial of service. (CVE-2021-27922)

Jiayi Lin, Luke Shaffer, Xinran Xie, and Akshay Ajayan discovered that Pillow incorrectly handled certain ICO files. If a user or automated system were tricked into opening a specially-crafted ICO file, a remote attacker could possibly cause Pillow to consume resources, resulting in a denial of service. (CVE-2021-27922)

Record
USN-4763-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
pillow
PyPI
before 8.2.0
8.2.0
py3-pillow
Alpine:v3.14
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.15
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.16
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.17
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.18
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.19
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.20
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.21
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.22
before 8.1.2-r0
8.1.2-r0
Show 19 moreShow less
Affected packages
PackageAffectedFixed
py3-pillow
Alpine:v3.23
before 8.1.2-r0
8.1.2-r0
py3-pillow
Alpine:v3.24
before 8.1.2-r0
8.1.2-r0
pillow
Bitnami
before 8.1.1
8.1.1
pillow
Debian:12
before 8.1.1-1
8.1.1-1
pillow
Debian:13
before 8.1.1-1
8.1.1-1
pillow
Debian:14
before 8.1.1-1
8.1.1-1
pillow
PyPI
before 8.2.0, plus listed versions
1.01.11.21.31.4
Show 45 moreShow less
1.51.61.7.01.7.11.7.21.7.31.7.41.7.51.7.61.7.71.7.82.0.02.1.02.2.02.2.12.2.22.3.02.3.12.3.22.4.02.5.02.5.12.5.22.5.32.6.02.6.12.6.22.7.02.8.02.8.12.8.22.9.03.0.03.1.03.1.0.rc13.1.0rc13.1.13.1.23.2.03.3.03.3.13.3.23.3.33.4.03.4.1
8.2.0
pillow
PyPI
before 8.1.1, plus listed versions
1.01.11.21.31.4
Show 45 moreShow less
1.51.61.7.01.7.11.7.21.7.31.7.41.7.51.7.61.7.71.7.82.0.02.1.02.2.02.2.12.2.22.3.02.3.12.3.22.4.02.5.02.5.12.5.22.5.32.6.02.6.12.6.22.7.02.8.02.8.12.8.22.9.03.0.03.1.0.rc13.1.0rc13.1.03.1.13.1.23.2.03.3.03.3.13.3.23.3.33.4.03.4.1
8.1.1
pillow
Root:PyPI
before 7.0.0+aikido.2
7.0.0+aikido.27.0.0+aikido.3
pillow
Ubuntu:20.04:LTS
before 7.0.0-4ubuntu0.3, plus listed versions
6.1.0-16.1.0-1build16.2.1-27.0.0-47.0.0-4build17.0.0-4ubuntu0.17.0.0-4ubuntu0.2
7.0.0-4ubuntu0.3
pillow-python2
Ubuntu:Pro:20.04:LTS
All versions, plus listed versions
6.2.1-3~build16.2.1-36.2.1-3ubuntu0.1~esm16.2.1-3ubuntu0.1~esm2
None known
pillow
Ubuntu:16.04:LTS
From an advisory covering 8 CVEs
before 3.1.2-0ubuntu1.6, plus listed versions
2.9.0-13.0.0-13.0.0-1build13.1.0-13.1.1-1
Show 5 moreShow less
3.1.2-0ubuntu13.1.2-0ubuntu1.13.1.2-0ubuntu1.33.1.2-0ubuntu1.43.1.2-0ubuntu1.5
3.1.2-0ubuntu1.6
pillow
Ubuntu:18.04:LTS
From an advisory covering 8 CVEs
before 5.1.0-1ubuntu0.5, plus listed versions
4.1.1-3build24.3.0-2ubuntu15.0.0-15.1.0-15.1.0-1ubuntu0.25.1.0-1ubuntu0.35.1.0-1ubuntu0.4
5.1.0-1ubuntu0.5
pillow
Ubuntu:20.04:LTS
From an advisory covering 8 CVEs
before 7.0.0-4ubuntu0.3, plus listed versions
6.1.0-16.1.0-1build16.2.1-27.0.0-47.0.0-4build17.0.0-4ubuntu0.17.0.0-4ubuntu0.2
7.0.0-4ubuntu0.3
python-CairoSVG
openSUSE:Leap 15.2
From an advisory covering 13 CVEs
before 2.5.1-lp152.2.3.1
2.5.1-lp152.2.3.1
python-Pillow
openSUSE:Leap 15.2
From an advisory covering 13 CVEs
before 8.3.1-lp152.5.3.1
8.3.1-lp152.5.3.1
python-Pillow
openSUSE:Tumbleweed
From an advisory covering 17 CVEs
before 8.3.2-1.2
8.3.2-1.2
python-Pillow
openSUSE:Tumbleweed
From an advisory covering 18 CVEs
before 10.3.0-1.1
10.3.0-1.1
python-Pillow
openSUSE:Tumbleweed
From an advisory covering 24 CVEs
before 12.3.0-1.1
12.3.0-1.1

History

History
RecordedChangedSources
affected
affectedOSV
affected, aliases, factsOSV
affectedOSV
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-25291 is a high vulnerability (CVSS 7.5) in Python Pillow, published March 3, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.40%, the 72nd percentile. Fixed in pillow 8.2.0.

References

Show 45 moreShow less
This page doesn't list everything

Left out here: 56 versions and the rest of 1 source description. The JSON record has them.

MoveEnter Open