PyPI: pillow
CVE-2026-40192
Safety vulnerability ID: SFTY-20260413-34319
Safety legacy ID: pyup.io-93093
Affected versions of the pillow package are vulnerable to Denial of Service due to unrestricted GZIP-compressed data consumption during FITS image decoding. The FITS image plugin does not limit the amount of GZIP-compressed data read when processing a FITS file, allowing unbounded memory allocation. An attacker can supply a specially crafted FITS file containing a GZIP decompression bomb, causing an out-of-memory crash or severe performance degradation.
Overview
FITS GZIP decompression bomb in Pillow
Advisory
Affected versions of the pillow package are vulnerable to Denial of Service due to unrestricted GZIP-compressed data consumption during FITS image decoding. The FITS image plugin does not limit the amount of GZIP-compressed data read when processing a FITS file, allowing unbounded memory allocation. An attacker can supply a specially crafted FITS file containing a GZIP decompression bomb, causing an out-of-memory crash or severe performance degradation.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260413-34319/CVE-2026-40192
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-40192
- https://data.safetycli.com/changelogs/pillow/
- https://github.com/advisories/GHSA-whj4-6x5x-4v2j
- https://pypi.org/project/pillow
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-whj4-6x5x-4v2j
- https://github.com/python-pillow/Pillow/pull/9521
- https://github.com/python-pillow/Pillow/commit/3cb854e8b2bab43f40e342e665f9340d861aa628
- https://pillow.readthedocs.io/en/stable/releasenotes/12.2.0.html#prevent-fits-decompression-bomb
- https://nvd.nist.gov/vuln/detail/CVE-2026-40192
- https://github.com/advisories/GHSA-whj4-6x5x-4v2j
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
