Description
Pillow is a Python imaging library. From 8.2.0 through 12.2.0, src/libImaging/Jpeg2KDecode.c accumulates total_component_width across every tile in a JPEG2000 image instead of recomputing it per tile, allowing a crafted tiled JPEG2000 file to force substantially higher transient memory usage and trigger out-of-memory failures during decoding. This issue is fixed in version 12.3.0.
Published: 2026-07-14
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Pillow, the Python imaging library, contained a flaw in its JPEG2000 decoder where the per‑tile calculation of the total component width was accumulated across all tiles instead of reset for each tile. This error caused the decoder to allocate a scratch buffer that grew with each tile, potentially reaching memory usage far beyond what the actual image requires. An attacker can exploit this by crafting a tiled JPEG2000 file that forces Pillow to consume a large amount of temporary memory, leading to an out‑of‑memory failure during decoding. The resulting crash or hanging of the process using Pillow manifests as a denial‑of‑service condition for the application.

Affected Systems

Python Pillow, versions 8.2.0 through 12.2.0. The library is widely used by Python applications that perform image processing, such as web servers, desktop tools, and automated pipelines.

Risk and Exploitability

The CVSS score of 8.7 signals a high severity vulnerability. Although the EPSS score is less than 1%, indicating a small current exploitation probability, the flaw is not listed in the CISA KEV catalog. Attackers would most likely embed a malicious JPEG2000 image in a payload—such as an uploaded file—to trigger excessive memory consumption in a process that imports Pillow. When memory exhaustion occurs, the process may crash or become unresponsive, resulting in a denial of service for the affected application.

Generated by OpenCVE AI on August 1, 2026 at 09:56 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Pillow to at least version 12.3.0, which corrects the buffer allocation logic.
  • If upgrade is not immediately possible, reject or validate JPEG2000 files before decoding, ensuring file sizes and tile counts are within acceptable limits to prevent excessive memory consumption.
  • Implement resource limits such as operating‑system cgroups or container memory limits, and monitor Pillow processes for abnormal memory usage; consider isolating image processing in a dedicated service or sandbox.

Generated by OpenCVE AI on August 1, 2026 at 09:56 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-vjc4-5qp5-m44j Pillow JPEG2000 tiled decode retains a growing scratch buffer and can be used for denial of service
History

Tue, 21 Jul 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-131
References
Metrics threat_severity

None

cvssV3_1

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

threat_severity

Important


Tue, 14 Jul 2026 17:00:00 +0000

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow

Tue, 14 Jul 2026 15:45:00 +0000

Type Values Removed Values Added
Description Pillow is a Python imaging library. From 8.2.0 through 12.2.0, src/libImaging/Jpeg2KDecode.c accumulates total_component_width across every tile in a JPEG2000 image instead of recomputing it per tile, allowing a crafted tiled JPEG2000 file to force substantially higher transient memory usage and trigger out-of-memory failures during decoding. This issue is fixed in version 12.3.0.
Title Pillow JPEG2000 tiled decode retains a growing scratch buffer and can be used for denial of service
Weaknesses CWE-789
References
Metrics cvssV4_0

{'score': 8.7, 'vector': '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'}


Subscriptions

Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-21T18:41:18.660Z

Reserved: 2026-07-02T21:05:02.923Z

Link: CVE-2026-59204

cve-icon Vulnrichment

Updated: 2026-07-21T18:40:29.388Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-14T15:38:29Z

Links: CVE-2026-59204 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-01T10:00:04Z

Weaknesses
  • CWE-131

    Incorrect Calculation of Buffer Size

  • CWE-789

    Memory Allocation with Excessive Size Value