CVE-2026-55380·Python vulnerability
Pillow is a Python imaging library. Prior to 12.3.0, PIL/GdImageFile.py GdImageFile._open() read image dimensions from the GD 2.x header and stored them in self._size without calling Image._decompression_bomb_check(), allowing a crafted .gd file to trigger excessive C-heap allocation when loaded. This issue is fixed in version 12.3.0.
- Severity
- high
- Software
- Python
- Fixed in
- 12.3.0
- Published
- 2026-07-06
Affected versions
Until: 12.3.0
Fixed in: 12.3.0
How to fix this CVE
Update the Pillow library to version 12.3.0 or later to remediate this decompression bomb vulnerability in GD image file handling. The fix ensures that image dimension validation is properly enforced before memory allocation occurs, preventing maliciously crafted .gd files from causing excessive heap memory consumption. If you use Pillow for image processing, prioritize this update to eliminate the denial-of-service risk.
sudo dnf update python3-pillowDefensia detects this vulnerability
How to check if you are affected
- Check installed Pillow version: python3 -c "import PIL; print(PIL.__version__)"
- Verify if your application processes .gd format images: grep -r '\.gd' /path/to/app/config /path/to/app/uploads 2>/dev/null || echo 'No .gd files found in application directories'
- Search system logs for memory exhaustion events: grep -i 'out of memory\|oom-killer\|heap' /var/log/syslog /var/log/messages 2>/dev/null | head -20
- Confirm the patch: python3 -c "import PIL; print('Patched' if PIL.__version__ >= '12.3.0' else 'Vulnerable')"
FAQ
What is CVE-2026-55380?
CVE-2026-55380 is a denial-of-service vulnerability in Pillow's GD image file parser where crafted .gd files can trigger excessive C-heap memory allocation without proper validation, potentially crashing applications that process untrusted image files.
Is CVE-2026-55380 being actively exploited?
No, CVE-2026-55380 is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available.
What versions of Python are affected by CVE-2026-55380?
The vulnerability affects Pillow versions prior to 12.3.0. Any Python installation using an older version of the Pillow imaging library is at risk.
How do I check if my server is vulnerable to CVE-2026-55380?
Run: python3 -c "import PIL; print(PIL.__version__)" and verify the version is 12.3.0 or later. If it's earlier, your system is vulnerable.
Does Defensia detect CVE-2026-55380?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Pillow is installed on a monitored server, CVE-2026-55380 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/python-pillow/Pillow/blob/main/docs/releasenotes/12.3.0.rst
- https://github.com/python-pillow/Pillow/commit/f39b0ae6624eb2d7c5c5d651d9bb5fdbd96a8675
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-phj9-mv4w-65pm
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-phj9-mv4w-65pm
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-55380. Free for 1 server.
Get started free