CVE-2026-59197

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

HIGH
8.2
CVSS Score
Published: July 14, 2026 at 04:25 PM UTC
Updated: October 24, 2026 at 09:10 PM UTC
2 products affected across 2 vendorsPillowPillow

Using Pillow by python-pillow?

Get instant alerts when new vulnerabilities affect Pillow - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.2
Exploit prediction
EPSS 0.4%
SSVC
PoC

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 12.3.0
Affected range stops below 12.3.0, so it looks safe — our inference, not a vendor statement
v < 12.3.0
Affected range stops below 12.3.0, so it looks safe — our inference, not a vendor statement

References (4)

x_refsource_CONFIRMExploitVendor Advisory
Source: cverecord
https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr
x_refsource_MISCIssue TrackingPatch
Source: cverecord
https://github.com/python-pillow/Pillow/pull/9695
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/python-pillow/Pillow/releases/tag/12.3.0

SSVC — Action Prioritization

SSVCPoCAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

8.2HIGHGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
LOW
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-787CWE-190

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card