CVE-2026-112895 Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310)

High 8.7 Published Updated

Attackers can cause denial of service in applications using Pillow by supplying malicious PDFs that trigger excessive resource consumption during append operations.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-112895?

CVE-2026-112895 is a high-severity denial of service vulnerability in Python Pillow, published on 19 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-674

Which versions are affected by CVE-2026-112895?

3 open source packages ship an affected version, including pillow. It affects 1 product.

PackageAffectedFixed in
pillow BitnamiFrom 5.1.013.0.0
pillow PyPIFrom 5.1.013.0.0
pillow PyPIFrom 5.1.013.0.0

Products include Python Pillow.

How do I fix CVE-2026-112895?

Upgrade pillow to 13.0.0 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-112895 being exploited?

There is no known exploitation of CVE-2026-112895 in the wild and no public exploit code.

All Python Pillow vulnerabilities

Sources

Also known as BIT-pillow-2026-112895, DEBIAN-CVE-2026-112895, ECHO-96b2-16e7-d7c9, GHSA-p4wg-p73j-c528, ROOT-APP-PYPI-CVE-2026-112895, UBUNTU-CVE-2026-112895.

Is CVE-2026-112895 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free