Impact
Pillow, a widely used Python imaging library, contains a heap buffer overflow in its FlashPix (FPX) JPEG tile decoder. The flaw arises when the decoder selects a raw mode with two bytes per pixel but an unrecognized JPEG mode is decoded with four components, leading to write operations beyond the allocated tile buffer. This causes memory corruption and may give an attacker arbitrary code execution. The weakness is a classic heap overflow (CWE-122) and also involves improper bounds checking (CWE-787).
Affected Systems
The vulnerability affects all Pillow installations prior to version 13.0.0 that have the optional olefile dependency. Applications that load or thumbnail untrusted OLE2 FlashPix files through Pillow are therefore impacted. The fix is included in Pillow 13.0.0 and newer.
Risk and Exploitability
With a CVSS score of 9.2 the flaw is considered critical. The EPSS score is not available, and the vulnerability is not listed in CISA's KEV catalog, but the nature of the heap overflow and the ability to execute injected code mean that once an attacker can supply a crafted image to a vulnerable application, the attack can succeed with minimal effort. The likely attack vector is the ingestion of a malicious OLE2 FlashPix file by an application that relies on Pillow's image handling and has the olefile module installed. The risk is high for systems that process user-supplied images without additional validation.
OpenCVE Enrichment