Heap-based buffer overflow in Pillow - CVE-2026-59197

 

Heap-based buffer overflow in Pillow - CVE-2026-59197

Published: July 7, 2026


Vulnerability identifier: #VU137005
CSH Severity: High
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N/E:U/U:Amber
CVE-ID: CVE-2026-59197
CWE-ID: CWE-122
Exploitation vector: Remote access
Exploit availability: No public exploit available
Vendor: Alex Clark and Contributors
Affected software:
Pillow

Detailed vulnerability description

The vulnerability allows a remote attacker to cause a denial of service and overwrite heap memory.

The vulnerability exists due to a heap-based buffer overflow in the ImageFilter.RankFilter API and ImagingExpand function when processing a very large odd filter size through public rank-filter classes. A remote attacker can supply a specially crafted filter size to cause a denial of service and overwrite heap memory.

The issue is reachable through documented public classes including RankFilter, MedianFilter, MinFilter, and MaxFilter. If the image is also attacker-supplied, the out-of-bounds value written past the allocation can be influenced by source image border pixels.


How to mitigate CVE-2026-59197

Install security update from vendor's website.

Sources