CVE-2026-25990: Pillow Out-of-Bounds Write Vulnerability When Loading PSD Images
Summary
CVE-2026-25990: Pillow affected by out-of-bounds write when loading PSD images. Affects pillow versions >= 10.3.0, < 12.1.1. Fixed in 12.1.1. How to fix ↓
Also tracked for
The same CVE-2026-25990 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Pillow is a widely-used Python Imaging Library that adds image processing capabilities to your Python interpreter. It supports opening, manipulating, and saving various image file formats. With its extensive features, Pillow is a go-to library for developers needing to handle images in their applications. However, a recent vulnerability has been identified that affects versions 10.3.0 and above, specifically when loading PSD (Photoshop Document) images.
Vulnerability Detail
The vulnerability arises from an out-of-bounds write that can be triggered when loading specially crafted PSD images. This flaw can lead to potential data corruption or arbitrary code execution, posing significant security risks to applications that utilize Pillow for image processing. The issue is rooted in how the library handles certain image formats, making it crucial for developers to address this vulnerability promptly.
How To Fix
Latest published version: 13.0.0 as of 22 Oct 2026
pip install --upgrade "pillow==13.0.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
12.1.1
This is the first release that contains the fix.
pip install --upgrade "pillow==12.1.1"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary measure, you can prevent the loading of PSD images by using the 'formats' parameter in the Image.open() method. Here is an example of how to implement this:
from PIL import Image
Open an image while restricting formats
image = Image.open('your_image_file.jpg', formats=['JPEG', 'PNG'])
Conclusion
In summary, the vulnerability identified as CVE-2026-25990 poses a significant risk to applications using Pillow for image processing. It is essential to update to version 12.1.1 or later to mitigate this risk. Additionally, using the provided workaround can help prevent the issue until an update can be applied.
See every vulnerability recorded for pillow →
FAQ
The vulnerability is an out-of-bounds write that occurs when loading specially crafted PSD images, which can lead to data corruption or arbitrary code execution.
Pillow versions 10.3.0 and above are affected by this vulnerability.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
As a temporary workaround, you can restrict the formats that can be opened using the 'formats' parameter in the Image.open() method.
More information about the fix and release notes will be available at https://pillow.readthedocs.io/en/stable/releasenotes/index.html.
References
Related vulnerabilities
Recent vulnerabilities recorded for pillow.