CVE-2026-42311
Pillow: python-pillow: Pillow: Arbitrary code execution via malicious PSD file processing
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · May 9, 2026
Updated · November 5, 2026
Description
A flaw was found in Pillow, a Python imaging library. An attacker could exploit this vulnerability by tricking a user into processing a specially crafted malicious PSD file. This could lead to memory corruption, potentially causing the application to crash or allowing for arbitrary code execution.
Statement
This is an Important severity flaw in Pillow, a Python imaging library, that could lead to arbitrary code execution. The vulnerability requires a user to process a specially crafted malicious PSD file, which could result in memory corruption and allow an attacker to execute arbitrary code. Red Hat products that process untrusted image files using Pillow are at risk if they do not adequately sanitize input or operate in a sandboxed environment.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this vulnerability, users should avoid processing untrusted or suspicious PSD image files with applications that utilize the Pillow library. Implementing strict input validation and sanitization for image uploads and processing workflows can reduce the risk. Additionally, running applications that process untrusted content within a sandboxed environment can limit the potential impact of successful exploitation.
CVSS / CWE
CVSS 3.1 · 7.8CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CWE-120 · Buffer Copy without Checking Size of Input