Skip to content
Monday, October 19, 2026AboutContactRSS
Pillow 13.0.0 patches high-severity double-free flaw in Python imaging library
Vulnerabilities

Pillow 13.0.0 patches high-severity double-free flaw in Python imaging library

A memory corruption bug in older Pillow versions allows crashes via crafted image transforms. Version 13.0.0 fixes the issue.

Key points

  • CVE-2026-112402 is rated 8.7 HIGH severity by NVD.
  • The flaw affects Pillow versions prior to 13.0.0.
  • A fix is available in version 13.0.0.

A high-severity memory corruption vulnerability in the Pillow Python imaging library has been patched in version 13.0.0. The flaw, tracked as CVE-2026-112402, allows attackers to crash processes or corrupt memory through specific image transformation operations.

What happened

The National Vulnerability Database records CVE-2026-112402 with a CVSS score of 8.7, classifying it as a high-severity issue. The vulnerability exists in the Pillow library, a widely used Python imaging toolkit. According to the NVD record, the flaw is categorized under CWE-416, which relates to use-after-free errors. Specifically, the issue is a double-free memory error.

The bug manifests when the ImagingScaleAffine function encounters a selective allocation failure. This occurs during specific transformation operations, including Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations. These operations must use the default NEAREST resampling method to trigger the vulnerable code path. The fast path handling these operations is where the defect resides.

For the vulnerability to be triggered, a specific memory condition must be met. The output image allocation must succeed, but the additional per-column lookup allocation must fail. When this happens, the error handling path deletes the image storage. Later cleanup routines then attempt to release that same memory again, causing the double-free.

An attacker can exploit this by driving a large Image.transform() operation under memory pressure. This pressure helps force the selective allocation failure required to trigger the bug. The result is that the process can crash and may corrupt memory. The vendor has released version 13.0.0, which fixes this issue.

Why it matters

Memory corruption flaws like double-free errors are dangerous because they can lead to arbitrary code execution. While the NVD description notes the crash and corruption, such issues often serve as entry points for more severe attacks. Pillow is a foundational library for many Python applications that handle images.

Systems that process untrusted images are at higher risk. If an attacker can upload a crafted image to a service using Pillow, they might trigger the crash. This could lead to denial of service. In some cases, memory corruption might allow an attacker to execute code with the privileges of the application.

The requirement for memory pressure adds a layer of complexity to exploitation. Attackers must ensure the system is under strain when the transform occurs. However, in busy production environments, memory pressure is common. This makes the condition easier to meet than it might appear in a controlled test.

What to watch

  • Monitor for new advisories related to Pillow 13.0.0.
  • Check if any downstream applications bundle older Pillow versions.
  • Watch for reports of exploitation in the wild.
  • Review logs for unexpected crashes in image processing services.

Who needs to act first

Teams should prioritize systems that process untrusted images. Identify services that accept user-uploaded files or fetch images from external sources. These systems have direct exposure to crafted inputs. Roll out the update to these critical systems first. Test the new version in a non-production environment to ensure compatibility. Back up configurations before applying changes. If immediate updates are not possible, restrict image upload capabilities or add validation layers.

Background: CVSS score

The CVSS score explains vulnerability severity using a 0.0 to 10.0 scale. It measures attack vector, complexity, privileges required, and impact on confidentiality, integrity, and availability. You use this metric to prioritize patches, though you must adjust it for your specific environment to avoid wasting time on irrelevant threats.

Read the full guide: CVSS Score Explained: How to Read Risk Metrics and Prioritize Fixes

What to do and how to stay safe: Pillow

  • Verify which versions of Pillow are installed on your servers.
  • Upgrade to version 13.0.0 or later as soon as possible.
  • Monitor application logs for crashes related to image processing.
  • Restrict the size and type of images accepted by user-facing services.

Step-by-step guide: Virtual Patching Myths: What It Actually Fixes and Breaks

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

Frequently asked questions

What is the CVE ID for this Pillow vulnerability?

The CVE ID is CVE-2026-112402.

Which versions of Pillow are affected?

All versions prior to 13.0.0 are affected.

Is there a fix available?

Yes, the issue is fixed in version 13.0.0.

Sources

  1. CVE Program

Related stories