Critical Remote Code Execution in Python Pillow Library (CVE‑2026‑112900) Enables OS Command Execution via Crafted EPS Image
What It Is — Pillow, the de‑facto image‑processing library for Python, contains a critical remote‑code‑execution (RCE) flaw tracked as CVE‑2026‑112900. The vulnerability resides in Pillow’s handling of Encapsulated PostScript (EPS) files. When an application calls Image.open() on an EPS image, Pillow forwards the supplied filename directly to the external Ghostscript binary without sanitising the string. An attacker who can supply a malicious filename (e.g., $(rm -rf /tmp/*)) causes Ghostscript to execute arbitrary operating‑system commands on the host that runs the Python process.
The issue was disclosed on 3 October 2026 by the Pillow maintainers after internal testing revealed that a crafted EPS file could trigger command execution with the privileges of the Python interpreter. The CVSS base score is 9.8 (Critical), reflecting the ease of exploitation (no authentication required) and the potential for full system compromise. The flaw affects all Pillow releases prior to 10.2.0, which introduced a safe‑mode flag that disables the insecure filename forwarding.
Affected Products — Pillow ≤ 10.1.x (all Python 3.x versions) on any operating system where Ghostscript is installed. The vulnerability is exploitable wherever Pillow processes untrusted EPS images, including web‑application back‑ends, CI/CD pipelines that generate thumbnails, and server‑side image‑validation services.
Why It Matters for Trust & Control Assurance — This flaw tests the control objective of secure third‑party component management. Organizations that rely on open‑source libraries must demonstrate continuous monitoring of upstream vulnerabilities and maintain auditable evidence that vulnerable components have been remediated.
Recommended Actions
- Upgrade immediately to Pillow 10.2.0 or later, which disables the unsafe filename pass‑through by default.
- Disable EPS handling in environments where EPS files are not required (e.g., set
PILLOW_EPS_DISABLE=1). - Implement a Software Bill of Materials (SBOM) and integrate it with a vulnerability‑scanning pipeline that flags CVE‑2026‑112900.
- Review Ghostscript usage – restrict execution to a dedicated, least‑privileged container or sandbox.
- Document remediation in your change‑management system to provide audit‑ready evidence of the fix.
Source: The Hacker News – “Critical Flaw in Python’s Popular Pillow Image Library Allows Code Execution via a Crafted Image”