CVE-2026-112391: Pillow: PdfParser can recurse without limit in get_value() and linearize_page_tree()
Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow's PdfParser.getvalue() can recurse without a limit while reading nested PDF objects. The parser follows attacker-controlled arrays and dictionaries when an existing PDF is opened for append. An attacker can provide a deeply nested PDF to an application that saves an image with PDF append enabled. This can raise an uncaught RecursionError or terminate the worker, causing denial of 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 versions 5.1.0 through versions before 13.0.0 are exposed when they open an existing attacker-controlled PDF and save an image with PDF append enabled. The vulnerable parsing path follows nested arrays and dictionaries in that existing PDF.
What must an attacker provide to trigger the issue?
An attacker needs to supply a deeply nested PDF that the application uses as an existing PDF for an append operation. No privileges or user interaction are indicated by the supplied CVSS vector.
What is the impact if exploitation succeeds?
Processing the crafted PDF can cause an uncaught RecursionError or terminate the worker. The stated impact is denial of service; no confidentiality or integrity impact is indicated.
How can the issue be remediated?
Upgrade Pillow to version 13.0.0, which fixes the issue. If an immediate upgrade is not possible, avoid enabling PDF append for existing PDFs that may be attacker-controlled.