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.
Published: 2026-10-19
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service
Action: Immediate Patch
AI Analysis

Impact

Pillow, a widely used Python imaging library, contains an unbounded recursion flaw in its PDF parsing logic during an append operation. When processing a PDF, PdfParser follows page‑tree child references and previous‑trailer chains without performing cycle or duplication tracking. Deep or cyclic page‑trees and long chains of unique trailer offsets can exhaust the Python stack, raising a RecursionError. Additionally, repeated non‑cyclic \/Kids references can trigger super‑linear CPU and memory consumption. The resulting denial of service occurs before any output is written, and the flaw maps to CWE‑674 (Uncontrolled Recursion) and CWE‑835 (Excessive Resource Consumption). This vulnerability existed from Pillow 5.1.0 through 12.x and was fixed in version 13.0.0.

Affected Systems

The flaw exists in all Pillow releases from 5.1.0 up to, but not including, 13.0.0. Any Python environment that imports Pillow and uses Image.save with PDF append enabled is potentially vulnerable. The security advisory lists python-pillow:Pillow as the affected product. An application built with Pillow 5.1.0 through 12.x is impacted until it upgrades to 13.0.0 or later, where the issue is patched.

Risk and Exploitability

The CVSS score of 8.7 indicates a high severity. EPSS is not available, and the vulnerability is not listed in CISA KEV catalog, suggesting no confirmed exploitation as of the latest data. Attackers must supply a crafted PDF to an application that performs Image.save with append mode. Depending on how the application receives PDFs, the exploitation could be local or remote. The lack of cycle/duplication checks enables deep or cyclic page‑trees to exhaust the Python interpreter’s stack (CWE‑674), and repeated \/Kids references can trigger excessive CPU and memory use (CWE‑835). The result is a denial of service before any output is created.

Generated by OpenCVE AI on October 20, 2026 at 06:55 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update Pillow to version 13.0.0 or later to apply the fixed PDF parser implementation.
  • If upgrading is not immediately possible, configure or patch your application to disable PDF append functionality when calling Image.save.
  • Add input validation or enforce resource limits on PDF processing to mitigate the risk of stack exhaustion from malicious page trees or trailer chains.

Generated by OpenCVE AI on October 20, 2026 at 06:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-p4wg-p73j-c528 Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310)
History

Tue, 27 Oct 2026 15:15: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

Tue, 20 Oct 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 20 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-835
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


Tue, 20 Oct 2026 00:00:00 +0000

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

Mon, 19 Oct 2026 22:00:00 +0000

Type Values Removed Values Added
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.
Title Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310)
Weaknesses CWE-674
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/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-20T16:08:43.138Z

Reserved: 2026-10-19T20:16:09.856Z

Link: CVE-2026-112895

cve-icon Vulnrichment

Updated: 2026-10-20T15:19:09.235Z

cve-icon NVD

Status : Analyzed

Published: 2026-10-19T22:17:09.620

Modified: 2026-10-27T14:56:20.700

Link: CVE-2026-112895

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-19T21:57:14Z

Links: CVE-2026-112895 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T07:00:13Z

Weaknesses
  • CWE-674

    Uncontrolled Recursion

  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')