The widely utilized Python image library, Pillow, has been discovered to contain a significant vulnerability that could allow attackers to execute system commands by manipulating file names. Identified as CVE-2026-112900, this flaw pertains to how Pillow processes EPS images, potentially turning them into a security risk.
Understanding the Vulnerability
The core of the issue lies in Pillow’s interaction with Ghostscript, a software it uses to convert EPS image files into pixel data. The vulnerability emerges because Pillow does not adequately validate file names before passing them to Ghostscript, allowing malicious actors to inject commands. This flaw was addressed with the release of version 13.0.0 on October 16.
Pillow is pervasive in applications handling images in Python, from web uploads to machine-learning projects, with an estimated 436 million monthly downloads. The security update in version 13.0.0 addresses multiple issues, with two classified as critical, although no active exploits have been reported.
Technical Details and Impact
The vulnerability is triggered by the name of the file rather than its content, as detailed in the security advisory. This makes file upload endpoints that retain user-specified file names particularly vulnerable. The flaw affects Pillow versions from 2.6.0 to 12.3.0 and requires Ghostscript to be installed on the host system.
Aside from the EPS issue, the update also fixes other critical vulnerabilities such as a memory bug related to stale image data and overflow problems in JPEG decoding. These issues can potentially lead to code execution under certain conditions, such as when opening crafted files.
Recommendations for Mitigation
Users are strongly advised to upgrade to Pillow 13.0.0 to mitigate these vulnerabilities. This update necessitates the use of Python 3.11 or newer due to dropped support for Python 3.10. The command to upgrade is pip install -U “Pillow>=13.0.0”.
Until updating is possible, users should follow security advisories to minimize risk. These include disabling Ghostscript on systems processing untrusted uploads, avoiding certain JPEG functions on untrusted files, and treating in-memory TIFF operations cautiously to prevent exploitation.
By adhering to these recommendations, users can better protect their systems from potential attacks exploiting these vulnerabilities.
