VYPR
High severityNVD Advisory· Published Jun 2, 2021· Updated Aug 3, 2024

CVE-2021-28677

CVE-2021-28677

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Pillow before 8.2.0 uses a quadratic readline in EPSImageFile, allowing a malicious EPS file to cause a denial of service during the open phase.

Vulnerability

The vulnerability resides in Pillow's EPSImageFile readline implementation, which must handle any combination of \r and \n as line endings. The code accidentally used a quadratic method of accumulating lines while searching for a line ending, leading to excessive CPU consumption. This issue affects all Pillow versions before 8.2.0 and dates back to the PIL fork [1][4].

Exploitation

An attacker can exploit this by providing a specially crafted EPS file containing many lines that trigger the quadratic accumulation behavior. No authentication or special privileges are required; the file is processed during the open() phase of Pillow, before the image is accepted for opening. The denial of service occurs immediately upon opening the malicious file [1][2].

Impact

Successful exploitation results in a denial of service (DoS) condition. The open() call consumes an excessive amount of CPU time, potentially causing the application to hang or crash. There is no impact on confidentiality or integrity of data [1][2].

Mitigation

The vulnerability is fixed in Pillow version 8.2.0, released on 2021-04-01. Users should upgrade to 8.2.0 or later. No workaround is available for earlier versions [1][4].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
pillowPyPI
< 8.2.08.2.0

Affected products

11

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

10

News mentions

0

No linked articles in our index yet.