CVE-2026-59203
Modified Modified - Updated After Analysis

Pillow EPS Parser Infinite Loop Vulnerability

Vulnerability report for CVE-2026-59203, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-14

Last updated on: 2026-07-15

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-14
Last Modified
2026-07-15
Generated
2026-08-04
AI Q&A
2026-07-14
EPSS Evaluated
2026-08-02
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
python pillow From 12.0.0 (inc) to 12.3.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-835 The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-59203 is a vulnerability in the Pillow Python imaging library, specifically in its EPS parser (PIL/EpsImagePlugin.py). The issue occurs when the parser processes an EPS file containing a negative byte count in the %%BeginBinary directive.

When such a crafted EPS file is opened using Image.open(), the parser incorrectly accepts the negative byte count. This causes the parser to seek backwards to the same %%BeginBinary directive repeatedly, creating an infinite loop. The loop consumes CPU resources and can lead to a denial of service (DoS) condition.

The vulnerability affects Pillow versions 12.0.0 through 12.2.0. It does not require Image.load() or Ghostscript execution to be triggered. The fix, implemented in version 12.3.0, adds validation to reject negative byte counts by raising a ValueError, preventing the infinite loop.

Detection Guidance

Detecting this vulnerability involves checking if your system is running a vulnerable version of the Pillow library (versions 12.0.0 through 12.2.0). You can inspect installed Python packages to verify the Pillow version.

  • Check the installed Pillow version using the following command in a Python environment: pip show Pillow or python -m pip show Pillow. Look for the 'Version' field in the output.
  • If you are using a system-wide installation, you can also check the version by running: python -c "import PIL; print(PIL.__version__)".

To detect potential exploitation attempts, monitor for EPS files with malformed %%BeginBinary directives containing negative byte counts. However, this requires manual inspection of EPS files or implementing custom parsing logic to validate the byte count field.

  • Use network monitoring tools to detect unusual CPU spikes or hangs in applications processing EPS files, as this vulnerability can cause infinite loops and denial of service.
Impact Analysis

This vulnerability can impact you in the following ways:

  • Denial of Service (DoS): If your application uses Pillow to process EPS files, an attacker could provide a malicious EPS file that triggers an infinite loop. This would consume excessive CPU resources, causing your application to hang or crash, leading to service unavailability.
  • Resource Exhaustion: The infinite loop can lead to high CPU usage, which may slow down or disrupt other processes running on the same system, affecting overall system performance.
  • Security Risk: If your application processes user-uploaded or untrusted EPS files, this vulnerability could be exploited to disrupt your services, potentially leading to downtime or degraded user experience.

The impact is primarily on availability rather than confidentiality or integrity, as the vulnerability does not allow for data theft or modification. However, the disruption caused by a DoS attack can still have significant consequences for business operations or user trust.

Compliance Impact

This vulnerability may affect compliance with common standards and regulations in the following ways:

  • GDPR (General Data Protection Regulation): While GDPR primarily focuses on data privacy and protection, a denial of service (DoS) attack caused by this vulnerability could lead to service unavailability. Under GDPR, organizations must ensure the availability and resilience of processing systems (Article 32). Prolonged downtime or disruption could be seen as a failure to implement appropriate technical measures, potentially leading to non-compliance.
  • HIPAA (Health Insurance Portability and Accountability Act): HIPAA requires covered entities to ensure the confidentiality, integrity, and availability of electronic protected health information (ePHI). If a healthcare application using Pillow processes EPS files (e.g., medical imaging), this vulnerability could disrupt access to ePHI, violating the availability requirement. This could result in non-compliance with the HIPAA Security Rule (45 CFR Part 164, Subpart C).
  • Other Standards (e.g., ISO 27001, NIST): Standards like ISO 27001 and NIST frameworks emphasize the importance of maintaining system availability and protecting against threats. A DoS vulnerability could be considered a failure to implement adequate security controls, potentially leading to non-compliance with these standards.

While the vulnerability itself does not directly expose sensitive data, the resulting service disruption could have indirect compliance implications, particularly for organizations handling regulated data or operating in sectors with strict availability requirements.

Mitigation Strategies

The primary mitigation step is to upgrade the Pillow library to version 12.3.0 or later, where the vulnerability is fixed.

  • Run the following command to upgrade Pillow: pip install --upgrade Pillow or python -m pip install --upgrade Pillow.

If upgrading is not immediately possible, consider the following workarounds:

  • Avoid processing untrusted EPS files using Pillow's Image.open() function, as this is the primary attack vector.
  • Implement input validation for EPS files before processing them with Pillow. Ensure that the %%BeginBinary directive does not contain a negative byte count.
  • Monitor applications using Pillow for unusual CPU usage or hangs, which may indicate exploitation attempts.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-59203. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart