Skip to content
vulnpost
Tech and security news that matters
Vulnerabilities

Pillow EMF/WMF Heap Over-Read on Windows CVE-2026-96644

A high-severity flaw in Pillow before version 13.0.0 allows heap over-reads via crafted metafiles on Windows systems.

Pillow EMF/WMF Heap Over-Read on Windows CVE-2026-96644
Illustration: Vuln Post

Key points

  • Pillow versions prior to 13.0.0 are vulnerable to CVE-2026-96644.
  • The issue affects only Windows builds due to native handler code.
  • Version 13.0.0 includes the fix for this high-severity vulnerability.

Pillow versions older than 13.0.0 contain a high-severity vulnerability identified as CVE-2026-96644. This flaw affects Windows builds of the library and involves improper handling of EMF and WMF image dimensions. Security teams managing Python environments should verify their current Pillow version immediately. The vendor has released version 13.0.0 to address this specific memory safety issue.

In plain English

The vulnerability arises because Pillow stores image dimensions without checking their range on Windows. It passes these unchecked values to a native handler called drawwmf. This handler calculates memory allocation based on 16-bit header fields, which truncate large numbers. However, it copies data using the original 32-bit dimensions. This mismatch allows a crafted metafile to cause a heap over-read.

The background

The EMF branch computes size directly from signed 32-bit header fields without positivity checks. The native handler assigns 16-bit fields for width and height but uses untruncated integers for copy length. A file with large width but small height can pass decompression-bomb checks while triggering the overflow. This behavior is compiled only for Windows systems.

What changes now

Pillow 13.0.0 resolves this heap over-read issue. Users running affected versions must upgrade to this release to restore proper dimension validation. The update ensures that allocation sizes match copy lengths correctly. This prevents the memory exposure previously possible through malformed EMF or WMF files processed by the library on Windows platforms.

Who needs to act first

Teams should prioritize updating systems that process untrusted image files, especially those accepting EMF or WMF formats. Exposed web applications and file upload services require immediate attention. Validate the fix in a test environment before full deployment. Back up current configurations and dependencies to allow quick rollback if compatibility issues arise. Monitor logs for unusual memory access patterns during the transition period.

What to do and how to stay safe: Pillow

  • Audit inventory for Pillow versions older than 13.0.0 on Windows servers.
  • Restrict image uploads to safe formats like PNG or JPEG until patched.
  • Monitor application logs for crashes or memory errors when processing metafiles.
  • Verify that all dependent services restart correctly after applying the update.

Step-by-step guide: 7 Configuration Errors That Expose Systems to Zero-Day Exploits

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

Frequently asked questions

Which operating systems are affected by this vulnerability?

Only Windows builds are affected because the vulnerable native handler is compiled exclusively for Windows.

Is there a fix available for CVE-2026-96644?

Yes, upgrading to Pillow version 13.0.0 addresses this high-severity heap over-read issue.

What types of files can trigger this vulnerability?

Crafted EMF and WMF metafiles with specific dimension mismatches can trigger the heap over-read.

Sources

  1. GitHub Advisory Database
PillowCVE-2026-96644WindowsPythonEMF

Related stories