Vulnerability DatabaseCVE-2026-112392

CVE-2026-112392: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-112392 is a NULL pointer dereference and out-of-bounds read vulnerability in Pillow, the Python imaging library, affecting all versions prior to 13.0.0 (≤ 12.3.0). The flaw resides in the ImagingExpand() function in src/libImaging/Filter.c, which fails to handle zero-size images when rank-based filters (median, minimum, maximum, or rank filter) are applied, causing a native process crash (SIGSEGV). It was disclosed on October 17–19, 2026, with a fix released in Pillow 13.0.0. The vulnerability carries a CVSS v4.0 base score of 8.2 (High) (GitHub Advisory, Red Hat CVE).

Technical details

The root cause is classified as CWE-476 (NULL Pointer Dereference) and CWE-125 (Out-of-bounds Read). When ImagingExpand() processes a zero-width or zero-height image, it allocates a non-empty output buffer but then attempts to replicate edge pixels by reading imIn->image[y][0] — however, ImagingAllocateArray() leaves all line pointers NULL for zero-size images, so the first read dereferences a NULL pointer and kills the process with SIGSEGV. Zero-size images are easily produced via ordinary Pillow API calls such as Image.crop() with equal left/right or top/bottom coordinates, Image.new() with a zero dimension, or by opening a multi-page TIFF file whose second IFD declares ImageLength = 0. The fix, committed in PR #10130, adds an early return in ImagingExpand() that returns a zeroed image of the expanded size when the input has zero width or height, mirroring similar guards in BoxBlur.c and Offset.c (GitHub Advisory, Fix Commit).

Impact

Successful exploitation causes a denial of service by crashing the entire embedding process (e.g., a web worker or pipeline process) with SIGSEGV rather than raising a Python exception, disrupting service to legitimate users. The faulting access is a read at address 0 (or a small negative offset), so there is no memory disclosure or corruption beyond the crash — confidentiality and integrity are not affected. Applications that accept user-supplied crop coordinates or uploaded image files (particularly multi-page TIFFs) and subsequently apply median, minimum, maximum, or rank filters are directly at risk (GitHub Advisory).

Exploitability

There is no public proof-of-concept exploit code and no evidence of in-the-wild exploitation as of the disclosure date. The vulnerability is remotely exploitable without authentication or privileges, requiring only that an attacker can supply a crafted image (e.g., a zero-dimension crop or a specially crafted multi-page TIFF) to an application that applies rank-based filters. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (Red Hat CVE, GitHub Advisory).

Exploitation steps

  1. Identify a target application: Find a web application or service that uses Pillow (< 13.0.0) and applies a MedianFilter, MinFilter, MaxFilter, or RankFilter to user-supplied images.
  2. Craft a zero-size image input: Prepare a trigger using one of two methods:
    • Crop route: Supply crop coordinates where left right or top bottom (e.g., a bounding box of (3, 0, 3, 10)) to produce a 0×10 image via Image.crop().
    • TIFF route: Craft a multi-page TIFF file whose second IFD declares ImageLength = 0 (a minimal two-page TIFF of ~384 bytes is sufficient).
  3. Submit the malicious input: Upload the crafted image or supply the zero-dimension crop coordinates to the target application endpoint that processes images with rank-based filters.
  4. Trigger the crash: The application calls image.filter(ImageFilter.MedianFilter(3)) (or similar), which invokes ImagingExpand() → NULL pointer dereference → SIGSEGV, killing the worker process and causing a denial of service (GitHub Advisory).

Indicators of compromise

  • Process: Unexpected termination (SIGSEGV / signal 11) of Python worker processes handling image uploads or processing pipelines; repeated worker restarts in application server logs (e.g., gunicorn, uWSGI).
  • Logs: Application error logs showing worker crashes or process exits with non-zero status codes (negative return code corresponding to SIGSEGV) during image filter operations; absence of Python-level exceptions where crashes are expected.
  • Network: Repeated upload requests containing zero-byte-dimension images or crafted multi-page TIFF files (identifiable by ImageLength = 0 in the second IFD); unusual patterns of requests targeting image processing endpoints followed by service unavailability.
  • File System: Presence of core dump files (if enabled) from Python processes in the application working directory, potentially containing ImagingExpand in the stack trace (GitHub Advisory).

Mitigation and workarounds

Upgrade Pillow to version 13.0.0 or later, which includes the fix in src/libImaging/Filter.c (commit 443e313) that adds an early return for zero-size images in ImagingExpand() (Pillow 13.0.0 Release, Fix Commit). If immediate patching is not possible, implement input validation at the application layer to reject images with zero width or height before passing them to any rank-based filter (MedianFilter, MinFilter, MaxFilter, RankFilter). A Python-level guard such as if 0 in image.size: return image.copy() in the filter call path would also prevent the crash, though the C-level fix in 13.0.0 is the preferred solution (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

pillow

Affected

sid

pillow: 13.0.0-1

Fixed

trixie

pillow

Affected

RHEL / CentOS

Affected

RHEL 8

python-pillow.src

Affected

Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-116579MEDIUM5.9
  • Python logoPython
  • autobahn
NoYesOct 26, 2026
CVE-2026-116577MEDIUM5.3
  • Python logoPython
  • tornado
NoYesOct 26, 2026
CVE-2026-115927MEDIUM5.3
  • Python logoPython
  • pcs.src
NoYesOct 26, 2026
GHSA-xh55-3p42-7v2hMEDIUM4.8
  • Python logoPython
  • strawberry-graphql
NoYesOct 26, 2026
CVE-2026-116578LOW2.1
  • Python logoPython
  • pcs.src
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management