Skip to main content

Python Pillow EUVDEUVD-2026-104648

| CVE-2026-112406 HIGH
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-10-19 GitHub_M GHSA-f2g6-542v-9j58
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 cyclic PDF to app
  2. Exploit
    Trigger uncapped Parent walk in rewrite_pages()
  3. Impact
    Worker loops at full CPU, denies service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Loop termination conditions
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application use Pillow to append an image to an attacker-supplied PDF, which invokes PdfParser.rewrite_pages(); the attacker must craft a PDF whose page-tree nodes form a cycle via mutual Parent references, which the pre-13.0.0 code follows without cycle detection. Limiting factors: the vulnerable code path is only reached by applications that specifically append to/rewrite externally supplied PDFs, so deployments that merely open or convert images are not exposed; impact is confined to availability (CPU exhaustion of the processing worker) with no data exposure or code execution. Fixed in Pillow 13.0.0.

Impact

This is a denial-of-service issue (CWE-835 uncontrolled infinite loop) with no confidentiality or integrity impact - the CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H) correctly reflects availability-only impact scored 8.7 (High). The network vector and PR:N assume a scenario where an application accepts attacker-supplied PDFs over the network and appends an image to them, so real-world exploitability is entirely conditional on the consuming application exposing Pillow's PDF-append path to untrusted input - many Pillow deployments never touch PdfParser.rewrite_pages() at all, which materially lowers the practical blast radius versus the raw score. No EPSS score was provided in the input, so exploitation probability cannot be quantified. KEV status is not listed, so there is no confirmed active exploitation; no public exploit identified at time of analysis, though the fixing commit (b3ebf20c) ships a regression test (test_write_catalog_loop) that demonstrates the cyclic page-tree condition, making reproduction trivial for a motivated attacker. Net: a genuine but bounded availability risk - high-CVSS is justified for exposed PDF-processing workers, but for the large population of Pillow users who do not rewrite/append PDFs from untrusted sources, real priority is lower.

Exploit ScenarioDerived

An attacker uploads a malformed PDF whose page-tree nodes reference each other cyclically through Parent relationships to a service that uses Pillow to append an image to the uploaded PDF. When PdfParser.rewrite_pages() walks the page tree it never detects the cycle and loops forever, pinning the worker at 100% CPU and denying service to other requests. No authentication or user interaction is required by the CVSS vector (PR:N/UI:N), and no public exploit is identified, but the fix commit includes a test that reproduces the loop.

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 5.1.0 through versions before 13.0.0 allows unauthenticated remote attackers to exhaust a processing worker's CPU by supplying a crafted PDF whose page tree contains a Parent-reference cycle when an application uses Pillow to append an image to that PDF. The flaw is an uncontrolled infinite loop in PdfParser.rewrite_pages(), giving availability-only impact with no confidentiality or integrity effect. Vendor-released patch: 13.0.0; no public exploit identified at time of analysis.

RemediationAI

Upgrade to Pillow 13.0.0 or later. Vendor-released patch: 13.0.0, referenced by the GitHub advisory (https://github.com/python-pillow/Pillow/security/advisories/GHSA-f2g6-542v-9j58), release (https://github.com/python-pillow/Pillow/releases/tag/13.0.0), and fix commit (https://github.com/python-pillow/Pillow/commit/b3ebf20c694f2f12537a629c30229a1d5a53f777). If immediate upgrade is not possible, remove or restrict the feature that appends images to attacker-supplied PDFs, since deployments that only open or convert images do not reach rewrite_pages(); alternatively run such PDF rewriting in a low-privilege worker with strict CPU and wall-clock time limits, accepting that legitimate large jobs may be terminated and that timeouts are a compensating control rather than a fix.

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 PDF handling includes a parser that rewrites an existing PDF's page structure when appending an image, and PdfParser.rewrite_pages() walks Parent relationships in the page tree. Before 13.0.0, the loop does not detect repeated nodes, so a malicious PDF with mutually referencing Parent entries can cycle indefinitely. This is CWE-835 (Loop with Unreachable Exit Condition); the upstream commit b3ebf20c694f2f12537a629c30229a1d5a53f777 adds a processed_refs list to stop when a page-tree node repeats, and the accompanying test builds two pages whose Parent fields point at each other. The provided CPE is cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:*, while the advisory range is 5.1.0 until 13.0.0. The vulnerable path affects availability only and does not expose data or enable code execution.

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 remotely without auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is CPU-exhaustion DoS only, so C:N/I:N/A:H.

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:31 cve.org
HIGH 8.7

DescriptionCVE.org

Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny 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-835 (Loop with Unreachable Exit Condition).

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 releases 5.1.0 through versions before 13.0.0 carry a high-severity availability flaw that can tie up a processing worker's CPU when an application uses Pillow to append an image to a crafted PDF, potentially stalling PDF/image workflows and degrading service for dependent customers or internal teams. Leadership should care because affected processing pipelines may be business-critical, and remediation requires a coordinated upgrade to Pillow 13.0.0; no public exploit was identified at time of analysis.

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 installed Python imaging libraries
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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