CVE-2026-42311·Python vulnerability
Pillow is a Python imaging library. From version 10.3.0 to before version 12.2.0, processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution. This issue has been patched in version 12.2.0.
- Severity
- high
- Software
- Python
- Fixed in
- 12.2.0
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.15% — higher than 5% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2026-42311 scores 7.8 on CVSS, so a successful attack would be serious — but at 0.15%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 10.3.0
Until: 12.2.0
Fixed in: 12.2.0
How to fix this CVE
Update Pillow (Python's imaging library) to version 12.2.0 or later to remediate a memory corruption vulnerability in PSD file processing. Systems running Pillow versions 10.3.0 through 12.1.x should prioritize this update immediately, as processing malicious PSD files could trigger crashes or code execution. Verify your applications do not auto-load untrusted PSD files without validation.
sudo dnf update python3-pillowDefensia detects this vulnerability
How to check if you are affected
- Check installed Pillow version with: python3 -c 'import PIL; print(PIL.__version__)'
- List all Python packages with: pip list | grep -i pillow or python3 -m pip list | grep -i pillow
- Search application logs for PSD file processing errors: grep -r 'PSD\|.psd' /var/log/ | grep -i 'error\|crash\|segfault'
- Verify the fix by running: python3 -c 'import PIL; print("Pillow version:", PIL.__version__)' and confirm version is 12.2.0 or higher
FAQ
What is CVE-2026-42311?
This vulnerability affects Pillow, a Python image processing library, where maliciously crafted PSD (Photoshop) files can trigger memory corruption when opened, potentially leading to application crashes or arbitrary code execution.
Is CVE-2026-42311 being actively exploited?
No, this vulnerability is not listed on CISA's Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available, though the high CVSS score warrants prompt patching.
What versions of Python are affected by CVE-2026-42311?
Pillow versions 10.3.0 through 12.1.x are vulnerable; the issue is independent of Python version but requires Pillow to be patched to version 12.2.0 or later.
How do I check if my server is vulnerable to CVE-2026-42311?
Run `python3 -c 'import PIL; print(PIL.__version__)'` and compare the version against 10.3.0–12.1.x; any version in that range indicates vulnerability, while 12.2.0+ indicates it is patched.
Does Defensia detect CVE-2026-42311?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Pillow is installed on a monitored server, CVE-2026-42311 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-42311. Free for 1 server.
Get started free