GitHub Advisoryadvisory · PyPI
GHSA-g842-9rc4-69pw Pillow: Decompression bomb check bypass in SpiderImagePlugin.seek() leads to unbounded allocation DoS
HIGH
Official page ↗
- Aliases
- CVE-2026-96637
- Ecosystem
- PyPI
- Packages
- pillow
- Severity
- High
- CVSS vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- Weaknesses
- CWE-400, CWE-409
- Reviewed
- 2026-10-22
Affected packages
• PyPI pillow: < 13.0.0 → fixed in 13.0.0
Description
Summary
SpiderImagePlugin's seek() bypasses the decompression bomb check, allowing a tiny ( DecompressionBombWarning fires correctly.
• BYPASS: Image.open(stack, frame0=1x1) passes; im.seek(1) sets size (100,100) with NO DecompressionBombWarning/Error -> the check is bypassed.
Real-world impact: a large frame-1 nsam/nrow (e.g. 40000x40000) causes im.load() to allocate ~6.4 GB (mode F) with the bomb check fully bypassed, from a file under 1 KB.
Suggested fix
Call Image._decompression_bomb_check(self.size) at the end of SpiderImageFile._open() (or in seek() after _open()), mirroring GifImagePlugin / TiffImagePlugin. Optionally validate nsam/nrow are positive and sane in _open().
Credit: Yazan Balawneh - CyStack Security Team
pillow_poc_spider_bomb.py
Related
Alias · CVE (1)
- CVE-2026-96637 Pillow is a Python imaging library. vulnerability
References
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-g842-9rc4-69pw web
- https://nvd.nist.gov/vuln/detail/CVE-2026-96637 advisory
- https://github.com/python-pillow/Pillow/pull/10076 web
- https://github.com/python-pillow/Pillow/commit/7cb0e02389d8aac2a60896a490f572db0b07b841 web
- https://github.com/python-pillow/Pillow package
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0 web