CVE-2026-112895
8.7HighPublished 19 Oct 2026 · NVD status: Received · AI triage by gemini-3.8-flash
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
- Impact
- High impact on availability
- Weakness
- CWE-674
Impact
Remote attackers can crash services or exhaust CPU and memory via denial of service. They only need to submit a crafted PDF to an endpoint that appends images to PDFs using Image.save.
Root cause
PdfParser lacks cycle and duplication detection when traversing page-tree child references and trailer chains, causing uncontrolled recursion and super-linear resource consumption.
Affected systems
Pillow 5.1.0 through 12.x (before 13.0.0)
CVSS v4.0 · 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Fix & remediation
Upgrade Pillow to version 13.0.0 or higher. If patching immediately is not possible, disable PDF append operations or reject untrusted existing PDF files before appending.
$ pip install --upgrade 'pillow>=13.0.0'AI-suggested. Run it in staging first and check it against the vendor advisory. Why?
NVD 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.