PyPI: pillow

CVE-2026-96636

Safety vulnerability ID: SFTY-20261022-03680

Affected versions of the Pillow package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) due to decompression-bomb protection being enforced only on the first frame of multi-frame images. The `MpoImageFile.seek()` and `DcxImageFile.seek()` methods re-parse subsequent frame headers and reassign `self._size` without invoking `Image._decompression_bomb_check`, unlike `GifImagePlugin` and `TiffImagePlugin`, which correctly re-check on every `seek()` call. An attacker can craft an MPO or DCX file whose first frame is small enough to pass the initial bomb check but whose later frame declares extremely large dimensions, so that when an application iterates frames via `seek()` and `load()` (e.g., thumbnailers or format converters), Pillow decodes the oversized frame and commits excessive memory, resulting in denial of service through memory exhaustion.

Created at: Oct 22, 2026Updated at: Oct 22, 2026

Overview

Pillow: Decompression-bomb protection bypass via multi-frame seek() in MPO and DCX (MpoImageFile.seek / DcxImageFile.seek)

Advisory

pillow – Improper Handling of Highly Compressed Data (Data Amplification)

Affected Package

Affecting pillow package, versions< 13.0.0

Also affects

---

How to Fix

Upgradepillowto13.0.0or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more