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.
Overview
Pillow: Decompression bomb check bypass in SpiderImagePlugin.seek() leads to unbounded allocation DoS
Advisory
pillow – Improper Handling of Highly Compressed Data (Data Amplification)
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261022-38655/CVE-2026-96637
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-g842-9rc4-69pw
- https://nvd.nist.gov/vuln/detail/CVE-2026-96637
- https://github.com/python-pillow/Pillow/pull/10076
- https://github.com/python-pillow/Pillow/commit/7cb0e02389d8aac2a60896a490f572db0b07b841
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/advisories/GHSA-g842-9rc4-69pw
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
