CVE-2026-59197CWE-190CWE-787

Pillow: Heap out-of-bounds write in Pillow `ImageFilter.RankFilter` via integer overflow in `ImagingExpand`

High · published July 14, 2026

CVSS v3.1
8.2
EPSS
0%
Percentile
37.7
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
8.2 · HIGH
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
CVSS v4.0
Not supplied
EPSS
0.00445 · 37.7th percentile
Weaknesses
CWE-190 · Integer Overflow or Wraparound; CWE-787 · Out-of-bounds Write
Published
2026-07-14T16:25Z
EPSS history
Timeline
  • 14 JUL 16:25Z
    Pillow: Heap out-of-bounds write in Pillow `ImageFilter.RankFilter` via integer overflow in `ImagingExpand`
    cvelistv5