CVE-2026-59199

Pillow: Heap out-of-bounds write `Image.paste()` / `Image.crop()` via signed coordinate overflow

Published Jul 14, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
Pillow is a Python imaging library. Prior to 12.3.0, Pillow public image coordinate APIs can trigger a native heap out-of-bounds write when given coordinates near the signed 32-bit integer limits in Image.paste(), Image.crop(), or Image.alpha_composite(). This issue is fixed in version 12.3.0.

Analysis

AI-generated

Technical impact

Pillow is a widely used Python imaging library that exposes native C APIs for operations such as Image.paste(), Image.crop(), and Image.alpha_composite(). The CVE details a signed 32‑bit integer coordinate overflow that can trigger a native heap out‑of‑bounds write when these functions are called with coordinates near the signed 32‑bit limit. While the CVE text does not describe any subsequent exploitation, it is inferred that such a memory corruption could be leveraged for arbitrary code execution or other malicious actions if the application were to run with elevated privileges, or could lead to a denial‑of‑service. The vulnerability is classified under CWE‑190 (Integer Overflow or Wraparound) and CWE‑787 (Out‑of‑Bounds Write).

Affected Systems

All releases of the Pillow library made by the Python Pillow project that are older than version 12.3.0 are vulnerable. The issue can be triggered in any Python application that uses Image.paste(), Image.crop() or Image.alpha_composite() with coordinate values that approach the signed 32-bit integer limit. Pillow is commonly incorporated into web servers, content management systems, photo editors, and other image-handling tools, so the impact could span a large set of deployed software. The fix is incorporated in Pillow 12.3.0, which disables the vulnerable code path and validates coordinates against the 32‑bit boundary.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity, and the EPSS score of less than 1% suggests that exploitation is currently rare. The vulnerability is not listed in the CISA KEV catalog. The CVE information indicates that the overflow is triggered by the library’s native code, so the attack vector is inferred to require control over the image data passed to the vulnerable functions. If an attacker can supply images containing near‑limit coordinates, the overflow could be triggered. Because the CVSS metric does not specify remote or local vectors, the exact ease of exploitation remains uncertain; nevertheless, the potential for heap corruption and the high severity score warrant prompt attention.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 12.3.0 or newer in all affected installations.
  • Pin your project’s Pillow dependency to a fixed version 12.3.0 or higher to prevent accidental downgrades.
  • Validate any coordinate values supplied to Image.paste(), Image.crop() or Image.alpha_composite() to ensure they remain well within the signed 32‑bit range before calling the library.
  • Monitor image processing endpoints for anomalous coordinate values or crashes that may indicate an attempted exploitation.

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

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-6r8x-57c9-28j4 Pillow: Heap out-of-bounds write `Image.paste()` / `Image.crop()` via signed coordinate overflow
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. Prior to 12.3.0, Pillow public image coordinate APIs can trigger a native heap out-of-bounds write when given coordinates near the signed 32-bit integer limits in Image.paste(), Image.crop(), or Image.alpha_composite(). This issue is fixed in version 12.3.0.
Title Pillow: Heap out-of-bounds write `Image.paste()` / `Image.crop()` via signed coordinate overflow
Weaknesses CWE-190
CWE-787
References
Metrics 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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 15, 2026, 2:53 PM
Reserved
Jul 2, 2026, 7:53 PM
Status
Modified
Published
Jul 14, 2026, 4:17 PM
Modified
Oct 24, 2026, 9:10 PM
Severity
Important
Public date
Jul 14, 2026, 3:42 PM