CVE-2026-96644: Pillow: Heap over-read in WMF/EMF rendering via 16-bit dimension truncation (Windows builds)
Pillow is a Python imaging library. Prior to 13.0.0 on Windows, src/PIL/WmfImagePlugin.py passes unchecked 32-bit WMF or EMF dimensions to the native drawwmf handler in src/display.c. The handler sizes a DIB allocation from 16-bit-truncated bcWidth and bcHeight fields but copies pixel data using the original full dimensions. A crafted wide, short metafile can pass the pixel-count decompression-bomb check and make the Windows-only renderer read beyond the heap buffer, potentially disclosing memory or crashing the process. This issue is fixed in version 13.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Pillowto a version that resolves this vulnerability.Fixed in 13.0.0
Event History
Frequently Asked Questions
Which deployments are affected?
The issue affects Pillow versions before 13.0.0 when running on Windows. The vulnerable path is the Windows-only WMF/EMF renderer; non-Windows builds are not described as affected.
What does an attacker need to exploit this?
An attacker needs to cause the application to render a crafted WMF or EMF metafile. The malicious file uses wide, short dimensions that bypass the pixel-count decompression-bomb check while triggering the mismatched allocation and copy sizes.
What is the likely impact?
The renderer can read beyond a heap buffer, which may disclose process memory or crash the process. The provided information does not establish code execution.
What should be done if an immediate upgrade is not possible?
Avoid rendering untrusted WMF and EMF files on Windows until Pillow can be upgraded. Version 13.0.0 contains the fix.