CVE-2021-25292Python Pillow
Medium 6.5 No auth needed
Follow: this CVE · Python · Python Pillow We alert you by email or Slack (account required).
- Priority
- 54
- CVSS 3.1
- 6.5
- EPSS
- 1.7% probability of exploitation in 30 days · percentile 78
- Auth required
- No
- Published
- Mar 19, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-1333
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
What happens
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.
What to do
- Apply the vendor's security update for Pillow.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | pillow |
≥ 5.1.0 < 8.1.1 |
8.1.1 |
pip install "pillow>=8.1.1" |
| PyPI | pillow |
< 8.1.1 |
8.1.1 |
pip install "pillow>=8.1.1" |
Per OSV / GitHub Advisories (GHSA-9hx2-hgq2-2g4f, PYSEC-2021-38). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| python | pillow | < 8.1.1 |
Official advisories
- python313-Pillow-12.3.0-1.1 on GA media · SUSE · openSUSE-SU-2026:11261-1 · Jul 12, 2026 Critical
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.
- pillow.readthedocs.io Release Notes Vendor Advisory
- security.gentoo.org Third Party Advisory