IT SBIT Services
Schneeberger
DEEN
CVE tracker

Pillow: NULL pointer dereference in rank filters for zero-size images

CVE-2026-112392High 8.2

← All vulnerabilities

Summary

Pillow, a Python imaging library, can crash the whole Python process when a median, minimum, maximum or rank filter is applied to an image with zero width or zero height. Such images can be created with ordinary calls such as cropping with equal edges, or through a crafted multi-page TIFF. An attacker who can supply crop coordinates or an uploaded image to an application that applies these filters can stop its worker process; the flaw causes a denial of service only, without memory disclosure or code execution.

Affected

  • Pillow versions before 13.0.0 (the advisory lists affected versions as <= 12.3.0)

Fixed in

  • Pillow 13.0.0 (fix commit 443e3130a8c11594fd0e296afad497e11e678961)

Workaround

  • Validate that images have a non-zero width and height before applying a median, minimum, maximum or rank filter.
  • A Python-level guard in the rank filter code also stops the crash. These workarounds are not a substitute for upgrading.

Exploitation

  • CISA SSVC lists exploitation as 'poc' and automatable as yes.
  • No known exploitation in the wild according to available sources.

Our recommendation

  • Upgrade Pillow to 13.0.0 or later. Pillow 13 requires Python 3.11 or newer, so upgrade Python first where needed.
  • Check dependency trees and container images for indirect Pillow installs, and check for version pins below 13.0.0.
  • Prioritise internet-facing services that accept uploaded images and apply rank or median filters to them.
  • Until patched, validate image dimensions before filtering and monitor for unexpected worker crashes.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 15:40.

Original description (NVD)

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.

NVD references (4)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.