CVE-2026-54058·Python vulnerability
Pillow is a Python imaging library. Prior to 12.3.0, when Pillow loads an uncompressed McIdas AREA image from a filename through the mmap raw codec path, attacker-controlled header words can set a row stride smaller than the natural row width, causing pixel access such as Image.tobytes(), getpixel, convert, or save to read beyond the mapped region and disclose adjacent process memory or fault. This issue is fixed in version 12.3.0.
- Severity
- critical
- Software
- Python
- Fixed in
- 12.3.0
- Published
- 2026-07-14
Affected versions
Until: 12.3.0
Fixed in: 12.3.0
How to fix this CVE
Update Pillow to version 12.3.0 or later to remediate a critical memory disclosure vulnerability in the McIdas AREA image codec. The vulnerability allows attackers to read adjacent process memory by manipulating image headers when loading uncompressed AREA files. Ensure all Python environments using Pillow are patched immediately.
sudo dnf update python3-pillowDefensia detects this vulnerability
How to check if you are affected
- Run `python3 -c "from PIL import __version__; print(__version__)"` to check the installed Pillow version and verify it is 12.3.0 or higher
- Search application logs and configuration files for references to McIdas AREA image processing or use of `mmap` raw codec paths: `grep -r "AREA\|mmap" /var/log/ /etc/ --include="*.log" --include="*.conf"`
- Check Python process memory for unexpected access patterns by monitoring system calls: `strace -e mmap,mprotect -p <pid> 2>&1 | grep -i "stride\|area"`
- Verify the patch was applied by confirming Pillow version is 12.3.0+: `pip show Pillow | grep Version`
FAQ
What is CVE-2026-54058?
CVE-2026-54058 is a critical memory disclosure vulnerability in Pillow's McIdas AREA image decoder that allows attackers to read arbitrary adjacent process memory by crafting malicious image headers with undersized row strides, causing out-of-bounds reads during image processing operations.
Is CVE-2026-54058 being actively exploited?
No, CVE-2026-54058 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no public exploits are currently available. However, the critical severity warrants immediate patching.
What versions of Python are affected by CVE-2026-54058?
The vulnerability affects Pillow versions prior to 12.3.0. All Python installations using affected Pillow versions are vulnerable when processing McIdas AREA images from untrusted sources.
How do I check if my server is vulnerable to CVE-2026-54058?
Execute `pip show Pillow | grep Version` to check the installed version; if it is below 12.3.0, your system is vulnerable. Additionally, audit applications that process image files to identify if they handle McIdas AREA format.
Does Defensia detect CVE-2026-54058?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Pillow is installed on a monitored server, CVE-2026-54058 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/python-pillow/Pillow/commit/6a8de891fb00968e5ea79bfa84368ed90b3cfc1d
- https://github.com/python-pillow/Pillow/pull/9719
- https://github.com/python-pillow/Pillow/releases/tag/12.3.0
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-62p4-gmf7-7g93
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-62p4-gmf7-7g93
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-54058. Free for 1 server.
Get started free