CVE-2026-112406: High severity pypi/Pillow vulnerability
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.rewritepages() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Pillowto a version that resolves this vulnerability.Fixed in 13.0.0
Event History
Frequently Asked Questions
Which applications are exposed to this denial-of-service issue?
Applications using Pillow to append an image to attacker-supplied PDF files are exposed. The affected operation is PDF page rewriting through PdfParser.rewrite_pages().
What must an attacker provide to trigger the issue?
An attacker must supply a PDF whose page tree contains a cyclic Parent relationship. Processing that PDF in the affected image-append workflow can cause an infinite loop and keep a worker at full CPU.
Are default Pillow installations affected?
The issue affects Pillow versions from 5.1.0 up to, but not including, 13.0.0 when the application performs the affected PDF rewriting workflow. The provided information does not establish that all default uses of Pillow invoke this path.
What is the remediation?
Upgrade Pillow to version 13.0.0, which fixes the issue. If upgrading cannot happen immediately, avoid appending images to untrusted PDF inputs to prevent the vulnerable page-rewriting path from processing malicious files.