CVE-2026-55380: Pillow heap allocation overflow in GdImageFile decompression bomb check

CVE-2026-55380 · Severity: high · CVSS 7.5 · Published 2026-07-06

Pillow, a popular Python library for image processing, contains a vulnerability in how it handles GD 2.x image files. An attacker can provide a specially crafted, very small image file (about 1KB) that forces the library to attempt to allocate over 4GB of memory. This can lead to a denial-of-service condition where the application crashes or becomes unresponsive due to memory exhaustion.

Technologies: pillow (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-55380 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-55380 being exploited in the wild.
How severe is CVE-2026-55380?
High severity, with a CVSS score of 7.5, published 6 July 2026.
Which products and versions are affected?
pillow (PyPI) < 12.3.0, ECOSYSTEM:introduced=0,fixed=12.3.0.
Is there a fix for CVE-2026-55380?
Yes. pillow (PyPI): upgrade to 12.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-55380 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-55380?
Check whether you run pillow (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pillow (PyPI): upgrade to 12.3.0 or later
    pip install "pillow>=12.3.0"

Technical details

The GdImageFile plugin in Pillow does not call Image._decompression_bomb_check() during its _open() method. Because this plugin is not registered with the standard Image.register_open() system and is instead accessed via its own entry point (PIL.GdImageFile.open), it bypasses the library's global protection against decompression bombs. An attacker can craft a GD 2.x header (1,037 bytes) specifying maximum dimensions (65535x65535), which triggers a ~4.3 GB C-level heap allocation when load() is called. This exceeds the default DecompressionBombError threshold by approximately 24 times. The issue is fixed in Pillow version 12.3.0.

Affected products

  • python-pillow Pillow < 12.3.0

Identifiers

  • CVE-2026-55380
  • GHSA-phj9-mv4w-65pm
  • PYSEC-2026-2256

Timeline

  • 2026-06-08: disclosed: Confirmed unpatched on main branch
  • 2026-07-03: advisory: GitHub Advisory published
  • 2026-07-06: kev added: NVD publication date
  • 2026-07-20: patched: Updated in GitHub Advisory Database with patch version 12.3.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.