Impact
Pillow, a widely used Python imaging library, contains a heap out‑of‑bounds write caused by an integer overflow in the native function ImagingExpand. When the public RankFilter API receives a very large odd filter size, it expands the image before validating the size, and the unchecked signed integer arithmetic in ImagingExpand computes output dimensions that overflow. This flaw is a classic out‑of‑bounds write (CWE‑787) that can corrupt memory and potentially allow an attacker to execute arbitrary code. The underlying integer overflow (CWE‑190) is the root cause that enables the out‑of‑bounds write.
Affected Systems
The vulnerability affects all releases of Pillow older than version 12.3.0. Any Python application that imports Pillow and invokes ImageFilter.RankFilter with untrusted image data before the fix is at risk.
Risk and Exploitability
The flaw carries a CVSS score of 8.2, indicating high severity. The EPSS score is below 1 %, indicating a low probability of exploitation in the wild, and the vulnerability is not currently listed in CISA’s KEV catalog. The attack vector is inferred to be the processing of untrusted image data via the public RankFilter API; if an application processes user‑supplied images, the vulnerability is remotely exploitable. No public exploits have been reported, but the memory corruption could lead to arbitrary code execution on the host executing the image processing.
OpenCVE Enrichment
Github GHSA