Skip to content
Wednesday, October 21, 2026AboutContactRSS
Pillow Image Library Fixes High-Severity Double-Free Memory Flaw
Vulnerabilities

Pillow Image Library Fixes High-Severity Double-Free Memory Flaw

A memory corruption bug in older Pillow versions allows attackers to crash processes by triggering selective allocation failures during image transformations.

Key points

  • CVE-2026-112402 is rated High severity with a CVSS score of 8.7.
  • The flaw exists in Pillow versions prior to 13.0.0.
  • A fix is available in the 13.0.0 release.

Root cause

The vulnerability stems from a double-free error within the Pillow Python imaging library, specifically involving the `ImagingScaleAffine` function. According to the National Vulnerability Database, this issue occurs when the function encounters a selective allocation failure. The affected code path handles specific transformation operations, namely `Transform.EXTENT` or pure scale-and-translate `Transform.AFFINE` commands. These operations must use the default `NEAREST` resampling method for the flaw to be triggered. The root cause involves a mismatch in error handling during memory management.

Attack path

An attacker must be able to drive a large `Image.transform()` operation on a target system. The exploitation requires specific memory conditions: the system must be under memory pressure. The attack succeeds only if the primary output image allocation succeeds while the additional per-column lookup allocation fails. When this specific split occurs, the error path deletes the image storage prematurely. Subsequent cleanup routines then attempt to release the same memory block again. This double-free action crashes the process and may corrupt surrounding memory structures, according to the NVD record.

Affected versions

The National Vulnerability Database identifies the affected component as `python-pillow`. The vulnerability exists in all versions of Pillow prior to 13.0.0. Organizations running any older version of the library are exposed to this memory corruption risk. The fix is confirmed in version 13.0.0. Users of the library should verify their installed version against this threshold. Any version number lower than 13.0.0 is considered vulnerable to CVE-2026-112402.

Mitigation

  • Upgrade the Pillow library to version 13.0.0 or later to apply the vendor-provided fix.
  • Audit Python applications that use the `Image.transform()` method to identify dependencies on older Pillow versions.
  • Implement memory limits on services that process user-supplied images to reduce the likelihood of the specific allocation failure required for exploitation.
  • Monitor application stability logs for unexpected crashes in image processing modules.

Signals worth monitoring

Teams usually detect memory corruption issues by observing sudden application crashes or segmentation faults in logs. Check for unexpected process terminations in services that handle large image transformations. Look for errors related to memory allocation failures or double-free indicators in debug logs. If a service stops responding after processing a specific image file, isolate that input immediately. Review system memory usage trends to identify if attacks are attempting to induce pressure. Ensure logging captures the specific transformation parameters used before any crash occurs for later analysis.

What to do and how to stay safe: Pillow

  • Inventory all Python environments to identify which ones run Pillow versions older than 13.0.0.
  • Test the upgrade to version 13.0.0 in a staging environment to ensure compatibility with existing image processing logic.
  • Monitor application logs for crash events that correlate with high memory usage or large image processing tasks.
  • Review input validation policies for any services that accept and transform user-uploaded images.

Step-by-step guide: Attack Surface Management: 6 Common Misreadings and Correct Views

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

Frequently asked questions

What is the severity rating of CVE-2026-112402?

The National Vulnerability Database rates this vulnerability as High, with a CVSS score of 8.7.

Which specific functions in Pillow are vulnerable to this double-free flaw?

The flaw affects the `ImagingScaleAffine` function when it handles `Transform.EXTENT` or pure scale-and-translate `Transform.AFFINE` operations with `NEAREST` resampling.

Is there a confirmed fix for this vulnerability?

Yes, the issue is fixed in Pillow version 13.0.0, according to the NVD record.

Sources

  1. CVE Program
Pillowpython-pillowCVE-2026-112402NVDdouble-free

Related stories

Pillow FlashPix Heap Corruption Allows Code Execution in Python Apps

A crafted FlashPix file can crash or control Python applications using Pillow versions prior to 13.0.0 by overflowing memory buffers during image decoding.