Safeguard
Vulnerability Analysis•

CVE-2026-54058: Out-of-Bounds Read in Pillow McIdas Loader

CVE-2026-54058 is an out-of-bounds read in Pillow before 12.3.0 when opening McIdas AREA files by filename. Upgrade to 12.3.0 and check image pipelines.

Safeguard Security Team
3 min read

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

  1. Upgrade by raising the pillow requirement to 12.3.0 or later in your requirements or lock file, then reinstalling.
  2. Rebuild and redeploy container images that bundle Pillow.
  3. If you handle uploads, restrict which image formats you accept, so a rarely used format such as McIdas is rejected at the edge.
  4. 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

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.