PyPI: pillow

CVE-2026-96637

Safety vulnerability ID: SFTY-20261022-38655

Affected versions of the Pillow package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) due to a missing decompression bomb check on an alternate image-loading path. The `SpiderImageFile.seek()` method computes an attacker-influenced frame offset and calls `self._open()` directly rather than through `Image.open()`, causing `self._size` to be reassigned from unvalidated header fields (`nsam`, `nrow`) without ever invoking `Image._decompression_bomb_check()`, unlike sibling multi-frame plugins such as `GifImagePlugin` and `TiffImagePlugin`. An attacker can craft a SPIDER stack file under 1KB whose second frame header declares an extremely large image size, causing `ImageFile.load_prepare()` to call `Image.core.new()` with the unchecked dimensions and allocate multiple gigabytes of memory upon `im.load()`, resulting in a Denial of Service.

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

Overview

Pillow: Decompression bomb check bypass in SpiderImagePlugin.seek() leads to unbounded allocation DoS

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