IT SBIT Services
Schneeberger
DEEN
CVE tracker

Pillow: Double free in image transform on memory allocation failure

CVE-2026-112402High 8.7

← All vulnerabilities

Summary

Pillow, the Python imaging library, can free image memory twice in Image.transform() when a memory allocation fails inside ImagingScaleAffine. An attacker who can choose the output size of such a transform can crash the worker process and may corrupt its heap. The crash requires a memory limit or a 32-bit process; the EXTENT and scale/translate AFFINE paths with NEAREST resampling are affected, while resize(), thumbnail() and rotate() are not.

Affected

  • Pillow before 13.0.0 (GHSA advisory: up to and including 12.3.0)

Fixed in

  • Pillow 13.0.0 (fix commit aafa6c75f7cdabb9f409a8aac7c780bea31d08d9)

Workaround

  • Unknown. No workaround documented by the vendor.
  • Interim measure (own recommendation, not from the vendor): do not let untrusted users set output sizes for Image.transform(), and keep memory limits on image workers.

Exploitation

  • CISA SSVC assessment: exploitation 'poc' (proof of concept exists), automatable: yes, technical impact: partial.
  • The GHSA advisory describes the crash in detail and includes a reproducer.
  • No in-the-wild exploitation known. Not verified against the CISA KEV catalogue.

Our recommendation

  • Upgrade Pillow to 13.0.0 or later and remove version caps such as Pillow<13; test the application afterwards.
  • For OS-packaged Pillow, install the distribution's security update.
  • Check whether user input can set sizes for Image.transform() and restrict it.
  • Monitor image workers for crashes and MemoryError events.

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 can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after which the error path deletes image storage that later cleanup releases again. An attacker who can drive such a large Image.transform() operation under memory pressure may trigger the failure. This can crash the process and may corrupt memory. 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.