Description
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.
Published: 2026-10-21
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service via resource exhaustion
Action: Apply Patch
AI Analysis

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.

Generated by OpenCVE AI on October 22, 2026 at 15:42 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 13.0.0 or later, where the bug has been fixed.
  • Avoid using the append=True option when processing PDFs from untrusted sources; if append functionality is required, validate and sanitize the PDF to limit page count before processing.
  • Configure application‑level resource limits (for example, CPU quotas, timeouts, memory limits) for the image processing routine to mitigate the impact of potential resource exhaustion.

Generated by OpenCVE AI on October 22, 2026 at 15:42 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-mrfp-p49p-3hf2 Pillow PDF append accepts malformed shared page-tree DAG causing resource exhaustion
History

Wed, 28 Oct 2026 02:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 27 Oct 2026 14:45:00 +0000

Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow

Thu, 22 Oct 2026 12:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-770
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Important


Thu, 22 Oct 2026 04:45:00 +0000

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow

Wed, 21 Oct 2026 21:15:00 +0000

Type Values Removed Values Added
Description 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.
Title Pillow PDF append accepts malformed shared page-tree DAG causing resource exhaustion
Weaknesses CWE-400
CWE-407
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Python Pillow
Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-28T01:57:01.680Z

Reserved: 2026-09-23T14:35:50.130Z

Link: CVE-2026-96640

cve-icon Vulnrichment

Updated: 2026-10-28T01:56:53.719Z

cve-icon NVD

Status : Modified

Published: 2026-10-21T21:20:32.357

Modified: 2026-10-28T02:17:07.990

Link: CVE-2026-96640

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-21T21:03:22Z

Links: CVE-2026-96640 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T15:45:08Z

Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-770

    Allocation of Resources Without Limits or Throttling