# CVE-2026-54060: Python Pillow denial of service via excessive memory allocation in FontFile

Source: https://junglewise.ai/threats/cve-2026-54060-python-pillow-denial-of-service-via-excessive-memory-allocation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-06. Updated: 2026-07-20  
License: CC BY 4.0 with a link back

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

Pillow, a popular Python library for image processing, is vulnerable to a denial-of-service attack when processing specially crafted font files. An attacker can provide a malicious font file that, when loaded or converted, forces the library to allocate an enormous amount of memory, potentially crashing the application or the entire server. This affects services that allow users to upload or preview fonts, such as web-based font renderers or automated document processing pipelines.

Technologies: [pillow (PyPI)](https://junglewise.ai/threats/technologies/pillow). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-54060 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-54060 being exploited in the wild.

**How severe is CVE-2026-54060?** 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-54060?** 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-54060 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-54060?** 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

  ```sh
  pip install "pillow>=12.3.0"
  ```


## Technical details

A decompression bomb vulnerability exists in Pillow's `FontFile.compile()` method, which is used by `BdfFontFile` and `PcfFontFile`. The `compile()` method assembles glyphs into a combined bitmap using `Image.new()` without performing the standard `_decompression_bomb_check()`. Because these font formats are not registered via `Image.open()`, they bypass Pillow's global pixel limit guards. An attacker can provide a crafted BDF or PCF file where individual glyphs are below the warning threshold, but their cumulative size in the final bitmap exceeds the `DecompressionBombError` threshold (e.g., reaching 13.4 billion pixels or ~1.6 GB of memory). This can be triggered via `to_imagefont()` or `save()` calls. The issue is fixed in version 12.3.0.

## Affected products

- python-pillow Pillow < 12.3.0

## Identifiers

- CVE-2026-54060
- GHSA-5x94-69rx-g8h2
- PYSEC-2026-2254

## Timeline

- 2026-06-08: disclosed: Confirmed unpatched on main branch
- 2026-07-03: advisory: GitHub Advisory published
- 2026-07-06: kev added: NVD published date
- 2026-07-20: patched: Advisory updated with patch information

## References

- [https://api.github.com/users/dino320](https://api.github.com/users/dino320)
- [https://github.com/dino320](https://github.com/dino320)
- [https://api.github.com/users/dino320/gists%7B/gist_id%7D](https://api.github.com/users/dino320/gists%7B/gist_id%7D)
- [https://api.github.com/users/dino320/repos](https://api.github.com/users/dino320/repos)
- [https://avatars.githubusercontent.com/u/183065642?v=4](https://avatars.githubusercontent.com/u/183065642?v=4)
- [https://api.github.com/users/dino320/events%7B/privacy%7D](https://api.github.com/users/dino320/events%7B/privacy%7D)

## Related threats

- [Pillow heap buffer overflow in TIFF encoder with mismatched geometry tags](https://junglewise.ai/threats/cve-2026-128067-pillow-heap-buffer-overflow-saving-tiff-with-libtiff-when-tags)
- [Pillow memory denial of service in TIFF and EXIF parsing](https://junglewise.ai/threats/cve-2026-128066-pillow-memory-dos-in-tiff-and-exif-ifd-parsing-via-overlapping)
- [Pillow libtiff encoder memory disclosure and crash via crafted TIFF tags](https://junglewise.ai/threats/cve-2026-112902-pillow-memory-disclosure-and-segfault-in-libtiff-encoder-via)
- [Pillow EPS load decompression bomb check bypass in Ghostscript scaling](https://junglewise.ai/threats/cve-2026-112899-pillow-eps-load-scale-lets-ghostscript-render-past-the)
- [Pillow heap buffer overflow in bundled libopenjp2](https://junglewise.ai/threats/pillow-bundled-libopenjp2-2-5-4-in-all-wheels-since-11-1-0-carries-osv-cd00a842)
