cve.bz

CVE-2026-112895 python pillow: Uncontrolled Recursion

8.7 highExploit referenceEPSS 0.6%Fix available

High (8.7) in python pillow. EPSS 0.6% estimated probability of exploitation activity in the next 30 days. Fixed in pillow 13.0.0.

On this page
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.

Severity

CVSS 4.0

8.7 high
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

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
0.6% (unchanged from 0.6% a week ago) estimated probability of exploitation activity in the next 30 days; 49th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2026-10-20. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-674 Uncontrolled Recursion
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-112895 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-112895?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-112895?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-112895 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
python:pillowfrom 5.1.0 before 13.0.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-p4wg-p73j-c528PyPIpillow>=5.1.0 <13.0.013.0.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13pillowno fix listedDEBIAN-CVE-2026-112895
Debian14pillow13.0.0-1DEBIAN-CVE-2026-112895
Ubuntu22.04:LTSpillow9.0.1-1ubuntu0.7UBUNTU-CVE-2026-112895 USN-9064-1
Ubuntu24.04:LTSpillow10.2.0-1ubuntu1.5UBUNTU-CVE-2026-112895 USN-9064-1
Ubuntu26.04:LTSpillow12.1.1-2ubuntu1.5UBUNTU-CVE-2026-112895 USN-9064-1
Ubuntu26.10pillow12.3.0-1ubuntu2UBUNTU-CVE-2026-112895 USN-9064-1
UbuntuPro:14.04:LTSpillow2.3.0-1ubuntu3.4+esm6USN-9064-1
UbuntuPro:16.04:LTSpillow3.1.2-0ubuntu1.6+esm4USN-9064-1
UbuntuPro:18.04:LTSpillow5.1.0-1ubuntu0.8+esm3UBUNTU-CVE-2026-112895 USN-9064-1
UbuntuPro:20.04:LTSpillow7.0.0-4ubuntu0.9+esm2UBUNTU-CVE-2026-112895 USN-9064-1
UbuntuPro:20.04:LTSpillow-python2no fix listedUBUNTU-CVE-2026-112895
Red Hatenterprise_linux:8::appstreampython-pillow, python3-pillow, python-pillow-debuginfo and 3 more0:5.1.1-33.el8_10RHSA-2026:92639
Red Hatenterprise_linux:8::crbpython3-pillow, python3-pillow-tk, python3-pillow-doc and 5 more0:5.1.1-33.el8_10RHSA-2026:92639
Red Hatrhel_aus:8.4::appstream, rhel_eus_long_life:8.4::appstreampython-pillow, python3-pillow, python-pillow-debuginfo and 3 more0:5.1.1-15.el8_4.3RHSA-2026:98120
Red Hatrhel_aus:8.6::appstream, rhel_eus_long_life:8.6::appstreampython-pillow, python3-pillow, python-pillow-debuginfo and 3 more0:5.1.1-20.el8_6.2RHSA-2026:98111
Red Hatrhel_e4s:8.8::appstream, rhel_tus:8.8::appstreampython-pillow, python3-pillow, python-pillow-debuginfo and 3 more0:5.1.1-20.el8_8.2RHSA-2026:98109
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise High Performance Computing 15 SP5-ESPOS and 8 morepython-Pillow9.5.0-150400.5.28.1SUSE-SU-2026:5194-1
SUSELinux Enterprise Module for Package Hub 15 SP7python-Pillow7.2.0-150300.3.33.1SUSE-SU-2026:5038-1
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0python-Pillow11.3.0-160000.9.1SUSE-SU-2026:24656-1
SUSELinux Enterprise Server for NVIDIA 16.1python-Pillow11.3.0-160100.3.1SUSE-SU-2026:24701-1
openSUSELeap 16.0python-Pillow11.3.0-160000.9.1openSUSE-SU-2026:22246-1
openSUSELeap 16.1python-Pillow11.3.0-160100.3.1openSUSE-SU-2026:22301-1
AlmaLinux8python3-pillow, python3-pillow-tk, python3-pillow-doc and 1 more5.1.1-33.el8_10ALSA-2026:92639
Rocky Linux8python-pillow0:5.1.1-33.el8_10RLSA-2026:92639

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is rated as an Important severity flaw because an unauthenticated remote attacker can cause severe service disruption and denial of service without requiring elevated privileges. Red Hat products shipping Pillow—including components within Red Hat OpenShift AI, Ansible Automation Platform, and Satellite—are exposed only when configured to append images to untrusted, user-supplied PDF documents. Standard deployments that do not append to external PDF files or that generate new documents from trusted sources are unaffected.

Red Hat's mitigation

--- CME Mitigation Guidance (2026-10-20) ---

Disclaimer: The following mitigation solutions are provided as a courtesy, pending the application of an official patch. This content was generated utilizing AI tools in conjunction with data from https://cmetaxonomy.org. Customers are advised to independently evaluate and test these temporary mitigations within their own infrastructure.

The highest-value action is to disable PDF append operations or prevent untrusted PDF inputs from reaching Pillow Image.save calls: upgrade to Pillow 13.0.0 (or the fixed Python Pillow/Python3.11 Pillow/Rhoai/Odh Openvino Model Server Rhel/Rhelai3/Bootc Cuda Rhel/Rhelai3/Bootc Gaudi Rhel/Rhelai3/Bootc Rocm Rhel/Rhelai3/Disk Image Cuda Rhel/Python3X Pillow/Rhaiis/Vllm Spyre Rhel/Rhoai/Odh Kserve Storage Initializer Rhel/Rhoai/Odh Kserve Agent Rhel/Rhoai/Odh Kserve Controller Rhel/Rhoai/Odh Kserve Router Rhel/Rhoai/Odh Feature Server Rhel/Rhoai/Odh Trustyai Nemo Guardrails Server Rhel/Rhaiis/Vllm Tpu Rhel/Rhoai/Odh Training Cuda128 Torch29 Py312 Rhel/Rhoai/Odh Training Rocm64 Torch29 Py312 Rhel/Rhaiis/Vllm Cpu Rhel/Rhaiis/Vllm Neuron Rhel/Ansible Automation Platform 25/Lightspeed Chatbot Rhel/Openshift Lightspeed/Lightspeed Ocp Rag Rhel/Rhoai/Odh Th06 Cpu Torch291 Py312 Rhel/Rhoai/Odh Th06 Cuda130 Torch291 Py312 Rhel/Rhoai/Odh Vllm Gaudi Rhel/Python3.12 Pillow/Rhaii/Vllm Gaudi Rhel/Rhaii/Vllm Neuron Rhel/Rhaii/Vllm Tpu Rhel/Lightspeed Core/Lightspeed Stack Rhel/Rhoai/Odh Kserve Autogluon Server Rhel/Rhai Early Access/Docling Sdk Cuda Rhel/Rhai Early Access/Docling Serve Cuda Rhel/Rhoai/Odh Llm D Kv Cache Rhel/Rhoai/Odh Th06 Cpu Torch210 Py312 Rhel/Rhoai/Odh Th06 Cuda130 Torch210 Py312 Rhel/Rhoai/Odh Th06 Rocm64 Torch291 Py312 Rhel/Rhoai/Odh Workbench Jupyter Pytorch Llmcompressor Cuda Py312 Rhel/Ask Sre/Rhel Cla/Rlsapi Rhel/Rhaiis/Model Opt Cuda Rhel/Rhaiis/Vllm Cuda Rhel/Rhaiis/Vllm Rocm Rhel/Rhaii/Model Opt Cuda Rhel/Rhaii/Vllm Cpu Rhel/Rhaii/Vllm Cuda Rhel/Rhaii/Vllm Rocm Rhel/Rhaii/Vllm Spyre Rhel/Ansible Automation Platform/Automation Dashboard Rhel/Ansible Automation Platform 26/Hub Rhel/Ansible Automation Platform 26/Lightspeed Chatbot Rhel/Ansible Automation Platform 27/Hub Rhel/Ansible Automation Platform 27/Lightspeed Chatbot Rhel/Galaxy Ng/Automation Hub Container/Aap Rag Content/Ansible Chatbot Stack/Koku Report Emailer/Exploit Intelligence/Vulnerability Analysis Rhel/Insights Host Inventory/Google Lightspeed Agent/Lscore Deploy/Lightspeed Core/Rag Tool Cpu Rhel/Lightspeed Core/Rag Tool Cuda 12.9 Rhel/Lightspeed Services Ocp/Ocp Rules Rhel/Openshift Lightspeed Tech Preview/Lightspeed Rag Tool Rhel/Openshift Lightspeed/Lightspeed Service Api Rhel/Rhoai/Odh Caikit Tgis Serving Rhel/Rhoai/Odh Llama Stack Core Rhel/Rhoai/Odh Pipeline Runtime Pytorch Llmcompressor Cuda Py312 Rhel/Rhoai/Odh Automl Rhel/Rhoai/Odh Autorag Rhel/Rhoai/Odh Mlflow Rhel/Rhoai/Odh Pipeline Runtime Datascience Cpu Py312 Rhel/Rhoai/Odh Pipeline Runtime Pytorch Cuda Py312 Rhel/Rhoai/Odh Pipeline Runtime Pytorch Rocm Py312 Rhel/Rhoai/Odh Pipeline Runtime Tensorflow Cuda Py312 Rhel/Rhoai/Odh Pipeline Runtime Tensorflow Rocm Py312 Rhel/Rhoai/Odh Trustyai Garak Lls Provider Dsp Rhel/Rhoai/Odh Workbench Codeserver Datascience Cpu Py312 Rhel/Rhoai/Odh Workbench Jupyter Datascience Cpu Py312 Rhel/Rhoai/Odh Workbench Jupyter Pytorch Cuda Py312 Rhel/Rhoai/Odh Workbench Jupyter Pytorch Rocm Py312 Rhel/Rhoai/Odh Workbench Jupyter Tensorflow Cuda Py312 Rhel/Rhoai/Odh Workbench Jupyter Tensorflow Rocm Py312 Rhel/Rhoai/Odh Workbench Jupyter Trustyai Cpu Py312 Rhel/Rhai/Guidellm Rhel/Rhoai/Odh Ogx Core Rhel/Rhoai/Odh Th Torch Cpu Py312 Rhel/Rhoai/Odh Th Torch Cuda Py312 Rhel/Rhoai/Odh Th Torch Rocm Py312 Rhel/Quay/Quay Service Tool/Quay/Quay Rhel/Rhelai3/Bootc Aws Cuda Rhel/Rhelai3/Bootc Azure Cuda Rhel/Rhelai3/Bootc Azure Rocm Rhel/Rhelai3/Bootc Gcp Cuda Rhel builds), which replaces recursive page-tree traversal with an iterative stack of iterators and tracks visited object IDs in a set to reject duplicate or cyclic references, closing all 4 injection vectors (cyclic PDF page-tree child references, deeply nested PDF page trees, repeated non-cyclic /Kids references, long chains of unique PDF trailer offsets). Until patched, this is a concern on Applications accepting user-supplied PDF documents and invoking Image.save with PDF append enabled, so restrict user-supplied PDF uploads and audit application workflows to prevent untrusted files from being processed by Image.save with append=True. As a compensating measure, Enforce CPU and memory limits using ulimit or prlimit to cap resource consumption and contain host-level exhaustion, Deploy systemd service watchdogs with WatchdogSec and Restart directives to detect application hangs or process termination and restart services automatically, Enforce strict bounds on uploaded file size and structure complexity at the application boundary before passing data to Pillow's append parser, and Constrain process CPU and memory utilization using cgroups v2 to limit the blast radius of runaway loop traversal during PDF append operations. These controls limit blast radius and contain exploitation, but they do not fix the underlying uncontrolled recursion defect — apply the upstream patch to fully remediate.

Highest-impact CME: CME-114 Process Resource Limits (ulimit/prlimit) (medium)

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8python-pillow-0:5.1.1-33.el8_10Fixed 2026-10-29RHSA-2026:92639
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportpython-pillow-0:5.1.1-15.el8_4.3Fixed 2026-11-11RHSA-2026:98120
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-Onpython-pillow-0:5.1.1-15.el8_4.3Fixed 2026-11-11RHSA-2026:98120
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportpython-pillow-0:5.1.1-20.el8_6.2Fixed 2026-11-11RHSA-2026:98111
Red Hat Enterprise Linux 8.6 Extended Update Support Long-Life Add-Onpython-pillow-0:5.1.1-20.el8_6.2Fixed 2026-11-11RHSA-2026:98111
Red Hat Enterprise Linux 8.8 Telecommunications Update Servicepython-pillow-0:5.1.1-20.el8_8.2Fixed 2026-11-11RHSA-2026:98109
Red Hat Enterprise Linux 8.8 Update Services for SAP Solutionspython-pillow-0:5.1.1-20.el8_8.2Fixed 2026-11-11RHSA-2026:98109
Red Hat Satellite 6.16 for RHEL 8python-pillow-0:13.0.0-1.el8pcFixed 2026-11-05RHSA-2026:95655
Red Hat Satellite 6.16 for RHEL 8python-pyyaml-0:6.0.1-1.el8pcFixed 2026-11-05RHSA-2026:95655
Red Hat Satellite 6.16 for RHEL 9python-pillow-0:13.0.0-1.el9pcFixed 2026-11-05RHSA-2026:95655
Exploit Intelligenceexploit-intelligence/vulnerability-analysis-rhel9Affected
Lightspeed Corelightspeed-core/lightspeed-stack-rhel9Affected
Lightspeed Corelightspeed-core/rag-tool-cpu-rhel9Affected
Lightspeed Corelightspeed-core/rag-tool-cuda-12.9-rhel9Affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Affected
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Affected
Red Hat AI Inference Serverrhaiis/model-opt-cuda-rhel9Affected
Red Hat AI Inference Serverrhaiis/vllm-cpu-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-cuda-rhel9Affected
81 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-112895.

Attack patterns (CAPEC)

  • CAPEC-230 Serialized Data with Nested Payloads Likelihood: Medium · Severity: High
  • CAPEC-231 Oversized Serialized Data Payloads Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON