Pillow: Denial of service via malformed PDF page tree in append path
Summary
Pillow, a Python imaging library, does not track duplicate references when it expands the page tree of an existing PDF in the append path (Image.save with format="PDF" and append=True). An attacker who can supply a crafted PDF to an application that appends images can cause disproportionate CPU consumption before the operation completes. The impact is limited to availability; no confidentiality or integrity impact is described. The issue is not triggered by ordinary Image.open().
Affected
- Pillow from 5.1.0 up to and including 12.3.0 (CNA range: >= 5.1.0, < 13.0.0)
- Only applications that call Image.save(..., format="PDF", append=True) on attacker-influenced PDF files are affected
Fixed in
- Pillow 13.0.0
Workaround
- Unknown. No configuration workaround is documented; upgrading to 13.0.0 is the only fix identified.
- Until upgraded, do not pass untrusted PDF files to the append path.
Exploitation
- No evidence of exploitation in the wild; not listed in CISA KEV.
- CISA SSVC: exploitation status "poc", automatable: yes, technical impact: partial.
- The GHSA contains reproduction details; no independent public exploit repository was identified.
Our recommendation
- Check whether your applications use Pillow and whether they call the PDF append path with external PDFs.
- Upgrade Pillow to 13.0.0 or later and check dependency pins below 13 that block the upgrade.
- Until upgraded, do not process untrusted PDFs with append=True, especially in web forms, upload portals or automated document workflows.
- Prioritise internet-facing services; internal batch jobs with trusted input are lower priority.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-mrfp-p49p-3hf2 github.com
- Pillow 13.0.0 release notes github.com
- Fix commit 6f0e7ee github.com
- Pull request #10093 github.com
- OSV BIT-pillow-2026-96640 osv.dev
- GitLab advisory database CVE-2026-96640 advisories.gitlab.com
- VulDB 425011 vuldb.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 15:15.
Original description (NVD)
Pillow is a Python imaging library. From 5.1.0 until 13.0.0, PdfParser.linearize_page_tree() in src/PIL/PdfParser.py treats a PDF /Pages graph as a tree without tracking duplicate indirect references. When Image.save(..., format="PDF", append=True) processes an attacker-controlled existing PDF whose /Kids arrays repeatedly reference the same child /Pages node, Pillow expands the shared subtree as distinct pages. A compact malformed PDF can therefore create exponentially many page references and consume disproportionate CPU before the append completes. This issue is fixed in version 13.0.0.
NVD references (5)
- https://github.com/python-pillow/Pillow/commit/6f0e7ee1f9c2fe227906f8a4b926e6622b702bc7
- https://github.com/python-pillow/Pillow/pull/10093
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-mrfp-p49p-3hf2
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-mrfp-p49p-3hf2
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
