Heap-based buffer overflow in Pillow - CVE-2026-59197
Published: July 7, 2026
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.