CVE-2026-59197: CWE-787: Out-of-bounds Write in python-pillow Pillow
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.
AI Analysis
Technical Summary
Pillow versions before 12.3.0 contain a vulnerability in the ImageFilter.RankFilter.filter() function. When invoked with a very large odd filter size, the function calls image.expand(size // 2, size // 2) before validating the rank-filter size. The underlying ImagingExpand() function computes output dimensions using unchecked signed integer arithmetic, which can cause a native heap out-of-bounds write (CWE-787). This flaw can lead to memory corruption and potentially denial of service or other impacts. The issue is resolved in Pillow 12.3.0.
Potential Impact
The vulnerability allows an attacker to trigger a native heap out-of-bounds write, which can cause memory corruption. According to the CVSS vector, it requires no privileges or user interaction and can be exploited remotely over the network. The impact includes integrity loss and high availability impact, potentially leading to application crashes or denial of service.
Mitigation Recommendations
Upgrade to Pillow version 12.3.0 or later, where this vulnerability is fixed. No other mitigations are indicated. Patch status is confirmed by the vendor advisory stating the issue is fixed in 12.3.0.
CVE-2026-59197: CWE-787: Out-of-bounds Write in python-pillow Pillow
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.
CVSS v3.1
Score 8.2high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Pillow versions before 12.3.0 contain a vulnerability in the ImageFilter.RankFilter.filter() function. When invoked with a very large odd filter size, the function calls image.expand(size // 2, size // 2) before validating the rank-filter size. The underlying ImagingExpand() function computes output dimensions using unchecked signed integer arithmetic, which can cause a native heap out-of-bounds write (CWE-787). This flaw can lead to memory corruption and potentially denial of service or other impacts. The issue is resolved in Pillow 12.3.0.
Potential Impact
The vulnerability allows an attacker to trigger a native heap out-of-bounds write, which can cause memory corruption. According to the CVSS vector, it requires no privileges or user interaction and can be exploited remotely over the network. The impact includes integrity loss and high availability impact, potentially leading to application crashes or denial of service.
Mitigation Recommendations
Upgrade to Pillow version 12.3.0 or later, where this vulnerability is fixed. No other mitigations are indicated. Patch status is confirmed by the vendor advisory stating the issue is fixed in 12.3.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-02T19:53:48.831Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a56684768715ace43dcfe94
Added to database: 07/14/2026, 16:48:07 UTC
Last enriched: 07/21/2026, 20:08:19 UTC
Last updated: 08/27/2026, 22:52:12 UTC
Views: 54
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.