Skip to main content

Pillow EUVDEUVD-2026-104657

| CVE-2026-112895 HIGH
Uncontrolled Recursion (CWE-674)
2026-10-19 GitHub_M GHSA-p4wg-p73j-c528
8.7
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted PDF to append-enabled service
  2. Delivery
    Reach Image.save PDF append path
  3. Exploit
    PdfParser recurses page tree / trailer chain without cycle guard
  4. Execution
    Python stack or CPU/memory exhausted
  5. Impact
    Uncaught RecursionError or hang causes denial of service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
Exploitation Conditions

Exploitation requires the target application to call Pillow's Image.save with PDF append enabled (append=True) against an existing PDF whose contents the attacker can influence or supply - this is the specific feature/deployment prerequisite, and applications that do not append to PDFs are unaffected. The malicious PDF must contain a deep or cyclic page tree, a long chain of unique previous-trailer offsets, or repeated non-cyclic /Kids references to defeat PdfParser's missing cycle/duplication tracking. No authentication, user interaction, or special attack condition is otherwise needed (PR:N/UI:N/AT:N). The principal limiting factor is that PDF append is a non-default, application-specific operation; impact is confined to availability (crash/hang via RecursionError or CPU/memory exhaustion) with no confidentiality or integrity consequence.

Impact

All provided signals point to an availability-only denial-of-service issue, not a code-execution or data-exposure threat. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) describes a network-reachable, low-complexity, unauthenticated vector with no required attack conditions, and sets VC:N/VI:N/VA:H - confidentiality and integrity are explicitly untouched while availability impact is High, yielding the vendor score of 8.7. CWE-674 (Uncontrolled Recursion) is consistent with the description: unbounded page-tree/trailer-chain traversal exhausts the Python stack or CPU/memory. No EPSS score, KEV listing, SSVC decision, or public POC was supplied; per the input, there is no public exploit identified at time of analysis and no evidence of active exploitation. The headline 8.7 should be read with important caveats the raw CVSS metrics obscure: exploitation is NOT against default usage - it only triggers when an application deliberately calls Image.save with PDF append enabled against an attacker-influenced existing PDF, which is an uncommon code path. The AV:N/PR:N/UI:N metrics therefore describe worst-case exposure, but the realistic attack surface is narrower than the score alone implies. Net: a genuine, easy-to-weaponize DoS for the specific minority of deployments using PDF append, but a lower practical priority than an 8.7 suggests for the broad Pillow install base, since impact is confined to availability and gated by a non-default operation.

Exploit ScenarioDerived

An attacker submits a specially crafted PDF (with a deeply nested or cyclic page tree, or many unique trailer offsets, or repeated non-cyclic /Kids references) to an application that appends new pages to it via Pillow's Image.save with PDF append enabled. When PdfParser parses the existing document, it recurses without cycle/duplication tracking and exhausts the Python stack (uncaught RecursionError) or consumes super-linear CPU and memory, crashing or hanging the service before any output is written. No public exploit code is referenced, but the malformed-PDF trigger is simple to construct from the advisory and test additions.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

Denial of service in Pillow (Python imaging library) versions 5.1.0 through 12.x allows remote attackers to crash or hang applications that append images to attacker-influenced PDFs. PdfParser lacks cycle and duplication tracking when following page-tree /Kids references and only guards against exact repeated trailer offsets, so a crafted PDF with a deep or cyclic page tree, repeated non-cyclic /Kids entries, or a long chain of unique previous-trailer offsets can raise an uncaught RecursionError or drive super-linear CPU and memory consumption before any output is written. Exploitation requires the target application to call Image.save with PDF append enabled against a PDF the attacker can supply; no public exploit code has been identified at time of analysis and the issue is not in CISA KEV, though the availability-only impact and trivial prerequisites justify prompt patching to 13.0.0.

RemediationAI

Upgrade to Pillow 13.0.0, the vendor-released patch that removes the recursive page-tree walk, adds /Type validation for page tree nodes, and fixes processed_ids scoping (commit e2ae7eacad6de68c37eb28b633a97bebacf2c5bf; advisory GHSA-p4wg-p73j-c528; release notes at https://github.com/python-pillow/Pillow/releases/tag/13.0.0). If upgrading immediately is not possible, stop passing attacker-supplied or attacker-influenced PDFs to Image.save(..., append=True) - either build new PDFs from scratch (append=False, which never parses an existing trailer/page tree) or fully re-generate the document instead of appending, at the cost of losing incremental-update semantics such as preserved annotations and signatures. Also enforce size and structural limits on uploaded PDFs before they reach Pillow and run PDF-writing code in a worker process with a memory cap and a wall-clock timeout so a RecursionError or runaway CPU/memory growth is contained as a failed job rather than an outage; the trade-off is added latency and the need to restart workers, but no application availability loss. Note that catching RecursionError alone is insufficient because the trailer-chain and duplicate-/Kids paths consume CPU and memory without necessarily recursing.

Affected VersionsENISA

Pillow 5.1.0, < 13.0.0

Affected Packages

pypi pillow fix: 13.0.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pillow's PdfParser (src/PIL/PdfParser.py) resolves the PDF document catalog's page tree by recursively descending /Kids arrays in linearize_page_tree(), and it reconstructs the cross-reference structure by walking /Prev trailer chains. Both traversals are built on recursion and, per CWE-674 (Uncontrolled Recursion), lack depth limits: page-tree descent has no visited-set and trailer-chain following only rejects an exactly repeated offset, so deep or cyclic structures exhaust the Python call stack. An additional logic gap allows repeated references to the same kid object to be expanded multiple times, producing super-linear (roughly quadratic or worse) CPU and memory growth because processed_ids is not shared across the whole traversal. The upstream fix (commit e2ae7eacad6de68c37eb28b633a97bebacf2c5bf, released in 13.0.0) replaces the recursive page-tree walk with an explicit iterator stack, validates that /Type of page tree nodes is /Pages, and scopes processed_ids correctly; the accompanying test writes a 2000-level acyclic page tree and asserts it linearizes without stack exhaustion. PdfParser is the parsing backend used when Pillow writes a PDF in append mode, i.e. Image.save(..., append=True) or the equivalent PdfImagePlugin path, so only applications using that specific write mode reach the vulnerable code. The CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* covers the affected version range 5.1.0 up to, but not including, 13.0.0.

Know when Pillow gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 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
vuln.today AI 7.5 HIGH

Attacker-supplied PDF processed by an append-enabled service needs no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is availability-only (A:H, C:N/I:N), matching CWE-674 resource exhaustion.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 19, 2026 - 23:18 EUVD
CVE Published
Oct 19, 2026 - 21:57 cve.org
HIGH 8.7

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 21 pypi packages depend on pillow (15 direct, 6 indirect)

Ecosystem-wide dependent count for version 5.1.0.

Technical POC Analysis

CWE-674 (Uncontrolled Recursion) in Pillow's PDF reader, src/PIL/PdfParser.py.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

Pillow, a widely used Python imaging library, contains a high-severity denial-of-service vulnerability that can crash or hang applications when they append images to attacker-supplied PDFs. Any service or workflow that processes untrusted PDFs through Pillow's PDF save/append functionality faces potential availability loss, which could disrupt customer-facing services and internal operations. Although no public exploit has been identified, the low attack complexity and broad deployment of Pillow make this a priority for remediation.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
High
Pillow is among the most widely deployed Python imaging libraries
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Pillow

View all
CVE-2022-30595 CRITICAL POC
9.8 May 25

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated

CVE-2026-59204 HIGH POC
8.7 Jul 14

Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG

CVE-2026-54058 HIGH POC
8.3 Jul 14

Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image

CVE-2026-59197 HIGH POC
8.2 Jul 14

Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c

CVE-2026-59200 HIGH POC
7.5 Jul 14

Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d

CVE-2021-23437 HIGH POC
7.5 Sep 03

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb

CVE-2025-48379 HIGH POC
7.1 Jul 01

Pillow is a Python imaging library. In versions 11.2.0 to before 11.3.0, there is a heap buffer overflow when writing a

CVE-2016-4009 CRITICAL
9.8 Apr 13

Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote

CVE-2014-3007 CRITICAL
10.0 Apr 27

Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v

CVE-2026-96639 CRITICAL
9.8 Oct 21

Pillow versions 11.0.0 through 12.x (fixed in 13.0.0) can reuse a stale native ImagingCore buffer when a multi-frame ima

CVE-2021-34552 CRITICAL
9.8 Jul 13

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters

CVE-2021-25289 CRITICAL
9.8 Mar 19

An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy