Vulnerability · Published Jul 14, 2026 · Assigned by GitHub_M
CVE-2026-59197Pillow: Heap out-of-bounds write in Pillow `ImageFilter.RankFilter` via integer overflow in `ImagingExpand`
High 8.2
In plain English
A high-severity out-of-bounds write in Pillow from python-pillow. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 39% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | python3-pillow | 5.1.1-23.el8_10 | ALSA-2026:48021 |
| AlmaLinux:8 | python3-pillow-devel | 5.1.1-23.el8_10 | ALSA-2026:48021 |
| AlmaLinux:8 | python3-pillow-doc | 5.1.1-23.el8_10 | ALSA-2026:48021 |
| AlmaLinux:8 | python3-pillow-tk | 5.1.1-23.el8_10 | ALSA-2026:48021 |
| Debian:12 | pillow | no fix listed | DEBIAN-CVE-2026-59197 |
| Debian:13 | pillow | no fix listed | DEBIAN-CVE-2026-59197 |
| Debian:14 | pillow | 12.3.0-1 | DEBIAN-CVE-2026-59197 |
| PyPI | pillow | 12.3.0 | GHSA-xj96-63gp-2gmr |
| PyPI | pillow | 12.3.0 | PYSEC-2026-3454 |
| Rocky Linux:8 | python-pillow | 0:5.1.1-23.el8_10 | RLSA-2026:48021 |
| Ubuntu:22.04:LTS | pillow | 9.0.1-1ubuntu0.6 | USN-8999-1 |
| Ubuntu:22.04:LTS | pillow | 9.0.1-1ubuntu0.6 | UBUNTU-CVE-2026-59197 |
| Ubuntu:24.04:LTS | pillow | 10.2.0-1ubuntu1.4 | USN-8999-1 |
| Ubuntu:24.04:LTS | pillow | 10.2.0-1ubuntu1.4 | UBUNTU-CVE-2026-59197 |
| Ubuntu:26.04:LTS | pillow | 12.1.1-2ubuntu1.4 | USN-8999-1 |
| Ubuntu:26.04:LTS | pillow | 12.1.1-2ubuntu1.4 | UBUNTU-CVE-2026-59197 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| python-pillow | Pillow | < 12.3.0 |
Weakness: CWE-787, CWE-190 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
References
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr x_refsource_CONFIRM
- https://github.com/python-pillow/Pillow/pull/9695 x_refsource_MISC
- https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1 x_refsource_MISC
- https://github.com/python-pillow/Pillow/releases/tag/12.3.0 x_refsource_MISC