CVE-2026-112895 · GHSA-p4wg-p73j-c528
Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310)
- Risk score
- 69/100
- CVSS
- 8.7 v4.0
- Exploit chance (30 days)
- 0.4%
- Published
- 19 Oct 2026
Open in the live forecast Today's forecast
What to know
- What it is
- Pillow has a vulnerability that can cause denial of service when parsing a PDF with deep or cyclic page trees or long trailer chains. An attacker can supply a malicious PDF to an application that calls Image.save with PDF append enabled, causing the application to consume excessive CPU and memory.
- Affected
- {'products': ['Pillow'], 'packages': [{'ecosystem': 'pip', 'name': 'pillow', 'vulnerable': '>= 5.1.0, < 13.0.0'}], 'versions': ['5.1.0', '13.0.0']}
- Fix
- Upgrade to version 13.0.0 or later
- Exploitation
- No known exploitation
Story map
At a glance
Pillow: Red, act today. Pillow has a heap buffer overflow and stale-heap disclosure in _tiffWriteProc when saving compressed TIFF data. This can crash the process and may allow code execution.
The flaws
- CVE-2026-112895: Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310) (CVSS 8.7 · EPSS 0%)
- CVE-2026-112393: Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO (CVSS 9.2 · EPSS 1%)
- CVE-2026-96639: Pillow multi-frame loaders can reuse stale native image storage after mode transitions (CVSS 9.8 · EPSS 1%)
- CVE-2026-112900: Argument Injection in Ghostscript call, potentially leading into RCE (CVSS 9.2 · EPSS 1%)
The fix
Upgrade Pillow: 13.0.0 or later on your release line
Who is exposed: {'products': ['Pillow'], 'packages': [{'ecosystem': 'pip', 'name': 'Pillow', 'vulnerable': '>= 2.0.0, < 13.0.0'}], 'versions': ['2.0.0', '13.0.0']}
Where it stands
- Public proof of concept
- 1 outlet covering it
How it unfolded
- 23 Oct, The Hacker News (press): Critical Flaw in Python’s Popular Pillow Image Library Allows Code Execution via a Crafted Image
Connects to
- Same weakness: CWE-674 (CWE-674). 57 other warnings in 30 days
Why it is Amber
- CVSS 8.7 high
- Remotely exploitable without logging in
- On your watchlist: PyPI
Affected packages
| Package | Ecosystem | Vulnerable | Fixed in |
|---|---|---|---|
| pillow | pip | >= 5.1.0, < 13.0.0 | 13.0.0 |
References
- https://github.com/advisories/GHSA-p4wg-p73j-c528
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-p4wg-p73j-c528
- https://nvd.nist.gov/vuln/detail/CVE-2026-112895
- https://github.com/python-pillow/Pillow/commit/e2ae7eacad6de68c37eb28b633a97bebacf2c5bf
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/advisories/GHSA-p4wg-p73j-c528
Original description
Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can exhaust resources while parsing an existing PDF during an append operation. PdfParser follows page-tree child references without cycle or duplication tracking and follows previous-trailer chains with only an exact repeated-offset guard, so deep or cyclic page trees and long chains of unique trailer offsets can exhaust the Python stack. Repeated non-cyclic /Kids references can also cause super-linear CPU and memory use. An attacker can supply such a PDF to an application that calls Image.save with PDF append enabled. This can raise an uncaught RecursionError or consume excessive CPU and memory before output is written, causing denial of service. This issue is fixed in version 13.0.0.
Last activity 19 Oct 2026. Patch Forecast updates every hour.