CVE-2026-112402 Pillow: Double free in ImagingScaleAffine on calloc failure via Image.transform

High 8.7 Published Updated

An attacker can trigger a double free in Pillow's image transformation logic under memory pressure, causing crashes or potential code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-112402?

CVE-2026-112402 is a high-severity use after free vulnerability in Python Pillow, published on 19 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-416

Which versions are affected by CVE-2026-112402?

4 open source packages ship an affected version, including pillow and Pillow. It affects 1 product.

PackageAffectedFixed in
pillow BitnamiAll versions13.0.0
pillow PyPIAll versions13.0.0
pillow PyPIAll versions13.0.0
Pillow PyPIAll versions13.0.0

Products include Python Pillow.

How do I fix CVE-2026-112402?

Upgrade pillow to 13.0.0 or later.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2026-112402 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-112402 exists.

All Python Pillow vulnerabilities

Sources

Also known as BIT-pillow-2026-112402, DEBIAN-CVE-2026-112402, ECHO-a535-18ec-2f2c, GHSA-7mwm-ghpf-9vrm, PYSEC-2026-4331, ROOT-APP-PYPI-CVE-2026-112402 and 1 more.

Is CVE-2026-112402 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free