CVE-2026-59200: Pillow: Decompression Bomb DoS via PdfParser.PdfStream.decode()
PdfParser.PdfStream.decode() in Pillow’s PdfParser.py calls zlib.decompress() with the bufsize parameter set to the value of the PDF stream’s Length field, without any upper bound on the actual decompressed output size. Python’s zlib.decompress() bufsize argument is an initial output buffer hint, not a maximum size limit — the function will expand memory until the full decompressed result is produced. A crafted PDF containing a FlateDecode-compressed stream decompresses to 1 GB of memory from a ~950 KB file, causing server OOM termination or severe degradation in any application that uses PdfParser to read untrusted PDF files.
References
- github.com/advisories/GHSA-jjj6-mw9f-p565
- github.com/python-pillow/Pillow/commit/f7a31ea75e460e108c37126da1f47812f21f6b09
- github.com/python-pillow/Pillow/pull/9718
- github.com/python-pillow/Pillow/releases/tag/12.3.0
- github.com/python-pillow/Pillow/security/advisories/GHSA-jjj6-mw9f-p565
- nvd.nist.gov/vuln/detail/CVE-2026-59200
Code Behaviors & Features
Detect and mitigate CVE-2026-59200 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →