CVE-2026-59197 Details
Description
Pillow is a Python imaging library. Prior to 12.3.0, Pillow's public rank-filter API can trigger a native heap out-of-bounds write when given a very large odd filter size because ImageFilter.RankFilter.filter() calls image.expand(size // 2, size // 2) before rank-filter size validation and ImagingExpand() computes output dimensions with unchecked signed int arithmetic. This issue is fixed in version 12.3.0.
A heap-based buffer overflow vulnerability has been identified in the Pillow library, specifically within the public rank-filter API. This issue arises from an integer overflow in the 'ImagingExpand' function, which is called by 'ImageFilter.RankFilter.filter()' before validating the filter size. The vulnerability is present in Pillow versions through 12.2.0 and can be exploited by providing a large odd filter size, leading to a native heap out-of-bounds write. The problem is exacerbated by unchecked signed integer arithmetic, allowing for manipulation of the output dimensions and causing a buffer overflow when the expanded image is processed.
Users can upgrade to Pillow version 12.3.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 21, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr | CISA-ADP | ExploitVendor Advisory |
| https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1 | [email protected] | Patch |
| https://github.com/python-pillow/Pillow/pull/9695 | [email protected] | Issue TrackingPatch |
| https://github.com/python-pillow/Pillow/releases/tag/12.3.0 | [email protected] | Release Notes |
| https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr | [email protected] | ExploitVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-190 | Integer Overflow or Wraparound | [email protected] |
| CWE-787 | Out-of-bounds Write | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| python pillow | < 12.3.0 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 21, 2026 | CVE Modified | CISA-ADP |
| Jul 21, 2026 | Initial Analysis | [email protected] |
| Jul 14, 2026 | New CVE Received | [email protected] |