Description
Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny 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: Apply Patch
AI Analysis

Impact

The flaw exists in Pillow's PdfParser.rewrite_pages method, causing an infinite loop when it encounters a page tree with a circular Parent reference. An attacker crafting a cyclic PDF and feeding it to an application that uses Pillow to append an image can trigger the loop, consuming the worker's CPU indefinitely and effectively denying service.

Affected Systems

Affected vendors: Python Pillow. The issue spans versions 5.1.0 through 13.0.0 inclusive. Versions 13.0.0 and later include the fix, as indicated by the release notes and security advisory.

Risk and Exploitability

The CVSS score of 8.7 indicates high severity. Without a published EPSS score, the probability of exploitation remains unknown, but since the flaw leads to a full‑CPU loop, it is likely to be a local or application‑level DoS. The vulnerability is not currently listed in the CISA KEV catalog. An application processing user‑supplied PDFs—such as document management or image editing tools that use Pillow—could be targeted; the attacker must provide a malicious PDF that triggers the cycle.

Generated by OpenCVE AI on October 20, 2026 at 06:58 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 infinite loop is fixed.
  • Implement input validation to detect circular Parent references in PDFs before invoking Pillow's rewrite_pages, or use an external library to sanitize PDFs.
  • Add a watchdog or CPU quota to PDF processing tasks to prevent a single process from monopolizing system resources.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-f2g6-542v-9j58 Pillow: Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle
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

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

Type Values Removed Values Added
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 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Mon, 19 Oct 2026 22:45: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 21:45:00 +0000

Type Values Removed Values Added
Description Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny service. This issue is fixed in version 13.0.0.
Title Pillow: Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle
Weaknesses CWE-835
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:57.551Z

Reserved: 2026-10-19T16:58:51.960Z

Link: CVE-2026-112406

cve-icon Vulnrichment

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

cve-icon NVD

Status : Analyzed

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

Modified: 2026-10-27T14:59:51.513

Link: CVE-2026-112406

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-19T21:31:49Z

Links: CVE-2026-112406 - Bugzilla

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')