Skip to main content

Python Pillow CVE-2026-59203

| EUVDEUVD-2026-43741 HIGH
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-07-14 GitHub_M GHSA-pg7v-jwj7-p798
7.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Access
    Upload crafted EPS to image endpoint
  2. Delivery
    Backend calls Image.open() on file
  3. Exploit
    EPS parser reads negative BeginBinary bytecount
  4. Execution
    Parser seeks backward, loops forever
  5. Impact
    Worker CPU exhausted, service hangs (DoS)

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

The target application must accept attacker-influenced EPS input and pass it to Pillow's Image.open() (or otherwise invoke EpsImagePlugin), running an affected version 12.0.0-12.2.0. The specific trigger is a crafted EPS file containing a %%BeginBinary directive with a negative byte count, which drives the parser to seek backwards and re-read the same directive endlessly. Limiting factors: exploitation is impossible if the deployment never handles EPS files or if image parsing is constrained to a non-EPS format allowlist; there is no authentication or user-interaction requirement beyond delivering the file, and impact is limited to availability (a hang/CPU exhaustion), not code execution or data disclosure.

Impact

The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, 7.5 HIGH) is internally consistent for an availability-only DoS: no confidentiality or integrity impact, low complexity, and no privileges or interaction beyond getting the target to parse the file. The real-world network reachability depends on whether the deploying application actually accepts and opens EPS input - many deployments never enable or expose EPS parsing, which meaningfully narrows exposure below what AV:N alone implies. No EPSS score, SSVC decision, or KEV entry was provided; absence of KEV and of a weaponized exploit suggests this is not under active exploitation. This is a legitimate availability priority for services that ingest untrusted images (single-request hang of a worker/thread), but it is not a code-execution or data-exposure issue, so it should be triaged as a moderate DoS-hardening fix rather than an emergency.

Exploit ScenarioDerived

An attacker uploads a crafted EPS file (or supplies one via a URL the service fetches) to any endpoint that thumbnails or converts images with Pillow. When the backend calls Image.open() on the file, the EPS parser enters an infinite loop and the worker process pegs a CPU core and never returns, so repeated submissions exhaust the worker pool and take the service offline. The fix PR contains a test reproducer showing the exact trigger (a '-1' byte count), so the trigger condition is publicly documented.

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

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

Alert me

AnalysisAIv2 – Jul 14, 2026

Denial of service in Python Pillow 12.0.0 through 12.2.0 lets a remote attacker hang an application by supplying a crafted EPS image whose %%BeginBinary directive declares a negative byte count, causing the EPS parser to seek backwards and re-parse the same directive forever. Any service that calls Image.open() on attacker-supplied EPS data is affected until upgraded to 12.3.0. No public exploit identified at time of analysis, though the upstream fix PR includes a test reproducer; the flaw is not listed in CISA KEV.

Earlier versions of this analysis (1)
v1 Jul 14, 2026 - 16:31 CVSS 5.3

Pillow's EPS image parser in versions 12.0.0 through 12.2.0 enters an infinite loop when processing a crafted EPS file with a negative byte count in the %%BeginBinary directive, enabling remote unauthenticated denial of service against any application that calls Image.open() on untrusted EPS input. The CVSS vector (AV:N/AC:L/PR:N/UI:N) confirms the attack requires no privileges and no user interaction, making it exploitable by any attacker who can supply a malicious file to an affected service. No active exploitation has been identified (not in CISA KEV) and no public exploit code is known at time of analysis; a vendor-released patch in version 12.3.0 resolves the issue.

RemediationAI

Vendor-released patch: upgrade to Pillow 12.3.0 (pip install --upgrade 'Pillow>=12.3.0'), which adds validation rejecting a negative %%BeginBinary bytecount; see GHSA-pg7v-jwj7-p798 and the 12.3.0 release notes at https://github.com/python-pillow/Pillow/releases/tag/12.3.0. Where an immediate upgrade is not possible, the most effective compensating control is to stop parsing untrusted EPS: reject EPS uploads at the application layer or restrict Image.open() to an explicit allowlist of expected formats (e.g. pass formats=['PNG','JPEG'] so EPS is never dispatched to the vulnerable plugin), which removes the attack surface at the cost of losing EPS support. If EPS must be processed, run the parsing in a sandboxed worker with a hard wall-clock timeout and per-request CPU limits so an infinite loop kills only that isolated job rather than the main service; the trade-off is added operational complexity and latency.

Affected VersionsENISA

Pillow 12.0.0, < 12.3.0

Affected Packages

pypi pillow fix: 12.3.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 is the de facto Python imaging library (fork of PIL) used for decoding and processing images across web backends, thumbnailing pipelines, and data-science tooling. The defect lives in PIL/EpsImagePlugin.py, which parses Encapsulated PostScript (EPS) DSC comments. When it encounters a %%BeginBinary directive it reads a declared byte count and uses it to advance through the binary section; because the value was never validated as non-negative, a negative count causes the file pointer to seek backwards to the same directive, which is then parsed again indefinitely. This maps to CWE-835 (Loop with Unreachable Exit Condition, i.e. an infinite loop). The affected CPE is cpe:2.3:a:python-pillow:pillow, and the fix (commit 03992618, PR #9708) adds an explicit check that raises ValueError 'BeginBinary bytecount cannot be negative'.

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 MEDIUM
NVD 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

Untrusted EPS reaches the parser over the network with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is an availability-only hang, 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
SUSE 6.2 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 5.3 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

4
Severity Changed
Jul 14, 2026 - 20:22 NVD
MEDIUM HIGH
CVSS changed
Jul 14, 2026 - 20:22 NVD
5.3 (MEDIUM) 7.5 (HIGH)
Patch available
Jul 14, 2026 - 18:20 EUVD
CVE Published
Jul 14, 2026 - 15:43 cve.org
MEDIUM 5.3

DescriptionNVD

Pillow is a Python imaging library. From 12.0.0 through 12.2.0, Pillow's EPS parser in PIL/EpsImagePlugin.py accepts a negative byte count in the %%BeginBinary directive, allowing a crafted EPS file to cause Image.open() to seek backwards to the same directive and parse it repeatedly in an infinite loop. This issue is fixed in version 12.3.0.

Executive ViewAI

Why It Matters

Python Pillow versions 12.0.0 through 12.2.0 contain a denial-of-service vulnerability enabling remote attackers to crash applications that process EPS image files. This affects web services, document handling platforms, and any backend processing user-supplied images, creating availability risks until systems are upgraded to version 12.3.0.

Business Impact: High
Compensating Controls

Apply vendor patch (Pillow 12.3.0). Interim mitigation: disable EPS image processing or restrict image uploads to safe formats (JPEG, PNG) in affected services until patching is complete.

Threat Intelligence Overview

EPSS Score
0.4%
Top 69% exploitable
Prevalence
High
Pillow is among the most-installed Python packages across web and data pipelines
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor 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 Yes
EPSS 0.4%
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
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: +20
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-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

CVE-2020-5312 CRITICAL
9.8 Jan 03

libImaging/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow. Rated critical severity (CVSS 9.8), this

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise Module for Package Hub 15 SP7 Not-Affected
SUSE Linux Enterprise Module for Python 3 15 SP7 Not-Affected
SUSE Linux Enterprise Server 15 SP7 Not-Affected

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