# CVE-2021-28677: Uncontrolled Resource Consumption in Pillow

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.47%, higher than 85% of CVEs (2026-11-30)
- Published: 2021-06-02T15:18:49.000Z
- Modified: 2026-09-08T08:48:18.662Z
- Also known as: GHSA-q5hq-fp76-qmrc, BIT-PILLOW-2021-28677, PYSEC-2021-93
- Weaknesses: CWE-400
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pillow (PyPI): before 8.2.0
- python pillow: before 8.2.0
- fedoraproject fedora: 33
- pillow (Bitnami): before 8.2.0

## Every score

- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:N/I:N/A:P`
- Bitnami Vulnerability Database: rating High

## References

- <https://pillow.readthedocs.io/en/stable/releasenotes/8.2.0.html#cve-2021-28677-fix-eps-dos-on-open> (advisory, third-party-advisory, web)
- <https://github.com/python-pillow/Pillow/pull/5377> (advisory, patch, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MQHA5HAIBOYI3R6HDWCLAGFTIQP767FL/> (vendor-advisory, web)
- <https://security.gentoo.org/glsa/202107-33> (advisory, third-party-advisory, vendor-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2021/07/msg00018.html> (advisory, mailing-list, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-28677> (advisory, web)
- <https://github.com/python-pillow/Pillow/commit/5a5e6db0abf4e7a638fb1b3408c4e495a096cb92> (web)
- <https://github.com/advisories/GHSA-q5hq-fp76-qmrc> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2021-93.yaml> (web)
- <https://github.com/python-pillow/Pillow> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MQHA5HAIBOYI3R6HDWCLAGFTIQP767FL> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MQHA5HAIBOYI3R6HDWCLAGFTIQP767FL/> (web)

## Sources

- CVE List: [CVE-2021-28677](https://www.cve.org/CVERecord?id=CVE-2021-28677), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-q5hq-fp76-qmrc](https://github.com/advisories/GHSA-q5hq-fp76-qmrc), CC-BY-4.0, modified 2024-10-14
- NVD: [CVE-2021-28677](https://nvd.nist.gov/vuln/detail/CVE-2021-28677), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-93](https://osv.dev/vulnerability/PYSEC-2021-93), CC-BY-4.0, modified 2023-12-06
- Bitnami Vulnerability Database: [BIT-PILLOW-2021-28677](https://osv.dev/vulnerability/BIT-PILLOW-2021-28677), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-28677 · Whole record: https://cve.day/CVE-2021-28677.json · Rebuilt by cve.day 2026-11-25T22:58:01.623Z
