Skip to content
Pillow Rank Filter Crash in Zero-Size Images Fixed in 13.0.0
Vulnerabilities

Pillow Rank Filter Crash in Zero-Size Images Fixed in 13.0.0

A high-severity flaw in older Pillow versions causes native crashes when processing zero-size images with rank-based filters, resolved in the latest release.

Key points

  • CVE-2026-112392 is rated CVSS 8.2 HIGH due to a null pointer dereference weakness.
  • The bug affects Pillow versions prior to 13.0.0 when applying specific image filters.
  • Attackers can trigger a crash by supplying or generating a zero-size image file.

A high-severity stability flaw in the Pillow Python imaging library allows attackers to crash native processes by supplying zero-size images. The issue, tracked as CVE-2026-112392, has been resolved in version 13.0.0, which patches the underlying memory handling error.

What happened

Prior to version 13.0.0, Pillow contained a vulnerability in its rank-based filter implementation that could dereference invalid image storage. According to the NVD record, the flaw is classified as CWE-476, a null pointer dereference. The issue arises specifically when an application applies a rank, median, minimum, or maximum filter to an image.

The crash occurs during the edge replication phase of image processing. The function ImagingExpand() allocates a non-empty output buffer but then faults while attempting to read the first pixel from empty input storage. This happens because the input image has zero size. The subsequent ImagingRankFilter function is never reached, as the process fails earlier.

An attacker can exploit this by supplying a zero-size image to an application that uses these specific filters. The attacker does not need to execute code; they only need to cause the application to process the malformed image. This results in a native process crash, effectively causing a denial of service for the affected application.

Why it matters

This vulnerability affects any software environment using Pillow versions older than 13.0.0. The CVSS score of 8.2 indicates a high severity risk, primarily due to the ease of triggering the crash. Applications that automatically process user-uploaded images are particularly exposed.

Developers relying on Pillow for image manipulation must verify their version numbers. The flaw is not in the core library loading but in specific filter operations. This means applications that do not use rank, median, minimum, or maximum filters may not be immediately impacted. However, the presence of the library in the dependency chain still poses a risk if those filters are ever invoked.

What to watch

  • Monitor application logs for unexpected native process crashes or segmentation faults.
  • Check for spikes in error rates when processing user-uploaded image files.
  • Review filter usage in code to identify if rank-based filters are applied.
  • Verify Pillow version in all environments to ensure it is 13.0.0 or later.

Signals worth monitoring

Teams usually detect this type of activity by reviewing application crash dumps and system logs for sudden process terminations. Check whether image processing services are restarting unexpectedly or returning error codes to users. Look for patterns where specific image submissions trigger immediate failures. Containment moves involve isolating the affected service and rejecting zero-size image inputs at the upload boundary. Analysts should correlate crash timestamps with recent image uploads to identify the trigger.

Background: CVSS score

CVSS provides a standardized vector for exploit difficulty and access requirements, not business value. A high score indicates an easy attack path, not necessarily significant damage. You must contextualize the score with your environment’s exposure, asset value, and compensating controls to determine true risk.

Read the full guide: CVSS Scores: Why High Numbers Mislead Your Risk Assessment

What to do and how to stay safe: Pillow

  • Update Pillow to version 13.0.0 or later in all affected environments.
  • Validate image dimensions before processing to reject zero-size files.
  • Monitor application logs for native crashes related to image filtering.
  • Review code to ensure rank-based filters are not applied to untrusted inputs.

General security guidance from the Firewall Chronicle newsroom. It is not confirmed advice from the organisations named in this story.

Frequently asked questions

Which versions of Pillow are affected by CVE-2026-112392?

All versions of Pillow prior to 13.0.0 are affected by this vulnerability.

What is the CVSS score for this vulnerability?

The CVSS score for CVE-2026-112392 is 8.2, which is rated as HIGH.

How can an attacker trigger this crash?

An attacker can trigger the crash by supplying a zero-size image to an application that applies rank, median, minimum, or maximum filters.

Sources

  1. CVE Program
PillowCVE-2026-112392PythonCWE-476Image Processing

Related stories

Pillow PDF Append Flaw Triggers RecursionError in Python Services

A high-severity vulnerability in Pillow allows crafted PDFs to exhaust resources during append operations, risking denial of service for affected Python applications.