CVE-2026-59203

Pillow EpsImagePlugin negative %%BeginBinary byte count causes infinite loop denial of service

Published Jul 14, 2026 CVSS 3.1 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability resides in the EPS parser of Pillow 12.0.0 through 12.2.0, where a negative byte count in a %%BeginBinary directive causes Image.open() to repeatedly seek backward to the same directive and reparse it. This unbounded loop exhausts CPU and memory resources, resulting in a denial of service. The weakness is a control‑flow bug that allows an attacker to trigger an infinite loop (CWE‑835).

Affected Systems

Pillow, a widely used Python imaging library, is impacted by this flaw. All releases from 12.0.0 up to 12.2.0 are vulnerable, while the issue is fixed in version 12.3.0. Applications that load or transform EPS files – especially those that accept user‑supplied documents – are at risk.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity, and the EPSS figure of less than 1% points to a low likelihood of exploitation in practice; the vulnerability is not listed in CISA’s KEV catalog. Based on the description, the attack vector likely requires an attacker to supply a crafted EPS file that the application processes with Image.open(), which in turn triggers the infinite loop. No code execution or privilege escalation is achieved; the impact is limited to service disruption on the affected host.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 12.3.0 or later
  • If an upgrade cannot be applied immediately, disable the EpsImagePlugin by removing its import or blocking EPS files from being opened with Image.open()
  • Implement input validation to reject EPS files with negative %%BeginBinary byte counts before passing them to Pillow
  • Monitor application logs and system resources for repeated parse errors or unusually high CPU usage that may indicate an exploitation attempt

Generated by OpenCVE AI on July 31, 2026 at 10:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-pg7v-jwj7-p798 Pillow EpsImagePlugin negative %%BeginBinary byte count causes infinite loop denial of service
Ubuntu USN Ubuntu USN USN-8999-1 Pillow vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow
Type Values Removed Values Added
Description 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.
Title Pillow EpsImagePlugin negative %%BeginBinary byte count causes infinite loop denial of service
Weaknesses CWE-835
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}

Weaknesses
  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 15, 2026, 1:52 PM
Reserved
Jul 2, 2026, 9:05 PM
Status
Modified
Published
Jul 14, 2026, 4:17 PM
Modified
Oct 24, 2026, 9:10 PM
Severity
Moderate
Public date
Jul 14, 2026, 3:43 PM