CVE-2026-54058 is a critical out-of-bounds read (CVSS 9.1) in Pillow, the Python imaging library. Before 12.3.0, opening a crafted uncompressed McIdas AREA image from a filename can read past the mapped region, leaking adjacent process memory or crashing. The fix is Pillow 12.3.0.
What's affected
- Pillow before 12.3.0, per the record.
- Fixed in 12.3.0.
- The advisory describes the path where the image is opened from a filename and memory mapped. Code that only reads images from byte streams is not described as affected, but upgrading is still the safe course.
How to check if you're exposed
List the installed version in each environment and container image that processes images.
pip show pillow
python -c "import PIL; print(PIL.__version__)"
For lock files, search for pillow in requirements.txt, poetry.lock or Pipfile.lock. Also find services that open user uploaded files by path, since those are the ones an attacker can reach.
What to do now
- Upgrade by raising the pillow requirement to 12.3.0 or later in your requirements or lock file, then reinstalling.
- Rebuild and redeploy container images that bundle Pillow.
- If you handle uploads, restrict which image formats you accept, so a rarely used format such as McIdas is rejected at the edge.
- Re-run a dependency scan to confirm no older copy remains in a transitive path.
Why it matters
The class is CWE-125, out-of-bounds read. The advisory explains that the loader took the row stride from header fields in the file and the mapping code checked the total range but never that the stride was at least one full row of pixels. A small stride makes each row read run past the mapped area.
The result is disclosure of memory next to the image data, or a fault that stops the process. The record does not mark the CVE as exploited in the wild. Image libraries are a common place for this kind of bug because they parse many formats from untrusted input.
For your own projects, the free in-browser dependency scan needs no install, and the Gold directory tracks this CVE.
Try it yourself
Click through it at your own pace, or open it full screen.
Quick check
Do I need to worry if I never use McIdas files?
The weakness sits in the McIdas loader, but Pillow registers it by default, so a crafted file can be offered to any code that calls Image.open on an upload. Upgrade.
Sources
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-62p4-gmf7-7g93
- https://github.com/python-pillow/Pillow/releases/tag/12.3.0
- https://github.com/python-pillow/Pillow/commit/6a8de891fb00968e5ea79bfa84368ed90b3cfc1d
Last reviewed: 19 October 2026.