CVE-2026-112406

Pillow: Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle

Published Oct 19, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

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
Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow
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

Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow
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'}

Weaknesses
  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 20, 2026, 4:08 PM
Reserved
Oct 19, 2026, 4:58 PM
Status
Analyzed
Published
Oct 19, 2026, 10:17 PM
Modified
Oct 27, 2026, 2:59 PM
Severity
Important
Public date
Oct 19, 2026, 9:31 PM