---
schema_version: '1.0'
id: security-20260723-e5b374
url: https://osv.dev/vulnerability/PYSEC-2026-3454
url_hash: e5b374dd9bd78523b30a6bd4bb34bf401a872a10ae33eea9deacac48a113b591
canonical_url: https://osv.dev/vulnerability/PYSEC-2026-3454
source: osv:pypa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-59197
- PYSEC-2026-3454
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
- pillow
- PyPI
lang: en
published_at: '2026-07-14T17:17:14Z'
fetched_at: '2026-07-23T06:59:45.017552Z'
updated_at: '2026-07-23T06:59:55Z'
status: published
content_hash: a85dddbfe7d3a109fe01ce9719e59ea812fc5ee06e38a5667440cfa00bf6d311
content_changed_at: null
license_note: full
summary: 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 vali
summary_source: rss
summary_en: 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 vali
entities: []
key_facts: []
related: []
related_auto: []
title: CVE-2026-59197 — pillow
---

# CVE-2026-59197 — pillow

## TL;DR
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 vali

## Key Points
- cve / CVE-2026-59197 / PYSEC-2026-3454 / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H / pillow / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
**Advisory:** PYSEC-2026-3454 (CVE-2026-59197)

**Affected (your watchlist):**
- `PyPI:pillow` 12.1.1 → fixed in 12.3.0 [docker/docker-llmwiki]
- `PyPI:pillow` 12.2.0 → fixed in 12.3.0 [docker/local+docker/mac]

**Details:**
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.

**References:**
- https://github.com/python-pillow/Pillow/releases/tag/12.3.0
- https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1
- https://github.com/python-pillow/Pillow/pull/9695
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr

_Data: OSV.dev (upstream: pypa) — https://osv.dev/vulnerability/PYSEC-2026-3454_

## Source
元記事: [CVE-2026-59197 — pillow](https://osv.dev/vulnerability/PYSEC-2026-3454) — published 2026-07-14T17:17:14Z
