IT SBIT Services
Schneeberger
DEEN
CVE tracker

Pillow: Out-of-bounds write in ImageMorph on zero-width images

CVE-2026-112397High 8.7

← All vulnerabilities

Summary

Pillow, a Python imaging library, writes outside a row buffer when ImageMorph.MorphOp.apply() processes a zero-width image. PPM and PGM input can produce such an image. An attacker who can supply such a file to an application that runs a morphology operation can crash the process. The advisory also mentions possible memory corruption, but no code execution has been reported.

Affected

  • Pillow versions before 13.0.0 (GitHub advisory lists up to 12.3.0)
  • Sources differ on the exact affected range; verify against NVD.

Fixed in

  • Pillow 13.0.0 (released 2026-10-16)
  • Distribution packages may still be vulnerable; check OS package status.

Workaround

  • No workaround is provided in the CVE record.
  • Until upgraded, do not run ImageMorph on untrusted images, and reject images with zero width or height before processing (own suggestion, not from a source).

Exploitation

  • Not listed in KEV.
  • CISA SSVC: exploitation 'poc', automatable 'yes'.
  • The advisory includes a PoC that reports a segmentation fault.
  • No evidence of in-the-wild exploitation found.

Our recommendation

  • Upgrade Pillow to 13.0.0 or later through normal dependency updates. Test first, as 13.0.0 drops Python 3.10 and changes some behaviour.
  • Check container images and OS packages for the Pillow version in use.
  • Identify applications that call ImageMorph on user-supplied PPM or PGM files. If there are none, the risk is low.
  • Monitor services that process uploads for 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, 01:55.

Original description (NVD)

Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. 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.