CVE-2026-112392

Pillow: NULL dereference in ImagingExpand via rank filters on zero-size images

Published Oct 19, 2026 CVSS 4.0 · 8.2 High EPSS < 1% KEV · Not listed
Description
Pillow is a Python imaging library. Prior to 13.0.0, Pillow's rank-based filters can dereference invalid image storage for a zero-size image. ImagingExpand() allocates a non-empty output and then faults while replicating edges by reading the first pixel from empty input storage; ImagingRankFilter is never reached. An attacker can supply or cause creation of a zero-size image to an application that applies a rank, median, minimum, or maximum filter. This causes a native process crash. This issue is fixed in version 13.0.0.

Analysis

AI-generated

Technical impact

Pillow’s rank‑based filters can trigger a null pointer dereference when processing a zero‑size image. The flaw occurs in ImagingExpand() before ImagingRankFilter is applied, causing the native image processing code to crash. The vulnerability is classified as an invalid null reference (CWE‑476) and does not provide code execution or data disclosure.

Affected Systems

The problem exists in all Python Pillow versions earlier than 13.0.0. Any Python application that imports Pillow and applies a rank, median, minimum or maximum filter to an image that is zero‑bytes in size is vulnerable.

Risk and Exploitability

The CVSS score is 8.2, indicating a high severity. EPSS data is not available and the issue is not listed in the CISA Known Exploited Vulnerabilities catalog. An attacker can trigger the flaw by providing or causing the creation of a zero‑size image that is then processed by a rank filter; the exploitation path is straightforward.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 13.0.0 or later.
  • Validate that images are non‑zero size before invoking any rank‑based filter.
  • If an upgrade is delayed, implement a pre‑check that rejects or safely handles empty images to prevent the crash.

Generated by OpenCVE AI on October 20, 2026 at 06:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-27h8-gf7j-v5hc Pillow: NULL dereference in ImagingExpand via rank filters on zero-size images
History
Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow
Type Values Removed Values Added
Weaknesses CWE-125
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Important

Type Values Removed Values Added
Description Pillow is a Python imaging library. Prior to 13.0.0, Pillow's rank-based filters can dereference invalid image storage for a zero-size image. ImagingExpand() allocates a non-empty output and then faults while replicating edges by reading the first pixel from empty input storage; ImagingRankFilter is never reached. An attacker can supply or cause creation of a zero-size image to an application that applies a rank, median, minimum, or maximum filter. This causes a native process crash. This issue is fixed in version 13.0.0.
Title Pillow: NULL dereference in ImagingExpand via rank filters on zero-size images
Weaknesses CWE-476
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 20, 2026, 2:50 PM
Reserved
Oct 19, 2026, 4:58 PM
Status
Analyzed
Published
Oct 19, 2026, 10:17 PM
Modified
Oct 26, 2026, 8:52 PM
Severity
Important
Public date
Oct 19, 2026, 9:17 PM