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

CVE-2021-28675

CVE-2021-28675

Description

An issue was discovered in Pillow before 8.2.0. PSDImagePlugin.PsdImageFile lacked a sanity check on the number of input layers relative to the size of the data block. This could lead to a DoS on Image.open prior to Image.load.

AI Insight

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

Pillow before 8.2.0 lacks a sanity check in PSD image parsing, allowing denial-of-service via crafted PSD files.

Vulnerability

The vulnerability resides in PsdImagePlugin.PsdImageFile._open() in Pillow before version 8.2.0. The code did not validate that the number of input layers (read from the file header) is consistent with the size of the layer data block. This allows an attacker to craft a PSD file with a large layer count but a small data block, causing excessive processing or memory allocation during Image.open(). The issue has been present since the PIL fork. [1][2]

Exploitation

An attacker needs to supply a specially crafted PSD file to a Pillow application that calls Image.open(). The file is parsed during the open() call, and the missing sanity check leads to a denial-of-service condition. No authentication or special privileges are required; the attack vector is network-based if the application processes user-uploaded images. [1][2]

Impact

Successful exploitation results in a denial-of-service (DoS) on the open() call, potentially causing high CPU or memory consumption, crashing the application, or making it unresponsive. No data disclosure or code execution is reported. [1][2]

Mitigation

The issue is fixed in Pillow 8.2.0, released on 2021-04-01. The fix adds a sanity check in _layerinfo() to ensure the layer block is long enough for the claimed number of layers. Users should upgrade to Pillow 8.2.0 or later. No workaround is available for older versions. [2][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

8

News mentions

0

No linked articles in our index yet.