Impact
Pillow, a widely used Python imaging library, has a flaw in versions 5.1.0 through 13.0.0 where the PdfParser.linearize_page_tree function treats a PDF /Pages graph as a tree and does not track duplicate indirect references. When an attacker crafts a PDF whose /Kids arrays repeatedly reference the same child /Pages node and an application calls Image.save(..., format="PDF", append=True), Pillow expands the shared subtree as separate pages, creating an exponential number of page references. This drains disproportionate CPU and can also lead to high memory usage before the append completes, resulting in a denial of service (CWE‑400, CWE‑407, CWE‑770).
Affected Systems
Python Pillow (Python imaging library) versions 5.1.0 through 12.x are vulnerable because of an oversight in the PDF parser. The vulnerability was fixed in release 13.0.0. Any deployment that processes untrusted PDFs using the append option and runs an earlier Pillow version is at risk.
Risk and Exploitability
The CVSS score of 8.2 indicates a high severity attack. The EPSS score of less than 1% reflects a very low but nonzero exploitation probability, and the vulnerability is not listed in the CISA KEV catalog. An attacker would need to supply a specially crafted PDF to a Python application that calls the append feature; the exploit is local to the application unless the application is exposed to untrusted input from external sources. Successful exploitation would consume CPU resources, potentially interrupting service availability, but no public exploits are currently known.
OpenCVE Enrichment
Github GHSA