CVE-2021-28677
Uncontrolled Resource Consumption in Pillow
Reported by mitre · Published June 2, 2021
pillow is fixed in 8.2.0 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| pillow | PyPI | 8.2.0 |
| python3-pillow | Amazon Linux | 9.4.0-2.amzn2023.0.1 |
| python-pillow-sane | Amazon Linux | 2.0.0-23.gitd1c6db8.amzn2.0.4 |
| py3-pillow | Alpine | 8.2.0-r0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| amazon:2023 | python3-pillow | 0 |
| amazon:2 | python-pillow-sane | 0 |
| alpine | py3-pillow | 0 |
| amazon:2 | python-pillow | 0 |
| PyPI | Pillow | 0 |
| amazon:2 | python-pillow-tk | 0 |
| n/a | n/a | * |
| amazon:2 | python-pillow-doc | 0 |
| amazon:2023 | python3-pillow-devel | 0 |
| amazon:2 | python-pillow-devel | 0 |
| amazon:2023 | python3-pillow-tk | 0 |
Timeline
- May 10, 2021 CVE Published
- Jun 3, 2021 EPSS Score (30 in total, the first dated here)
- Sep 8, 2025 CVE Updated
- Mar 7, 2026 Distribution Patch (5 in total, the first dated here)
- Mar 7, 2026 Security Advisory (9 in total, the first dated here)
- Aug 5, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-28677
vulnetix vdb fixes CVE-2021-28677
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-28677/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_MISC
- FEDORA-2021-77756994ba vendor-advisoryx_refsource_FEDORA
- GLSA-202107-33 vendor-advisoryx_refsource_GENTOO
- [debian-lts-announce] 20210722 [SECURITY] [DLA 2716-1] pillow security update mailing-listx_refsource_MLIST
- https://nvd.nist.gov/vuln/detail/CVE-2021-28677 advisory
- https://github.com/advisories/GHSA-q5hq-fp76-qmrc advisory
- https://github.com/python-pillow/Pillow/commit/5a5e6db0abf4e7a638fb1b3408c4e495a096cb92 patch
- https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2021-93.yaml advisory
- https://github.com/python-pillow/Pillow url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MQHA5HAIBOYI3R6HDWCLAGFTIQP767FL url