Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted cyclic PDF to app
-
ExploitTrigger uncapped Parent walk in rewrite_pages()
-
ImpactWorker 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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- 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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated
Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG
Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image
Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c
Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d
The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb
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
Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote
Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v
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
Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters
An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo
EUVD-2026-104648
GHSA-f2g6-542v-9j58
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB