Executive brief
Pillow, a popular Python image processing library, is vulnerable to a 'decompression bomb' attack when processing BDF font files. An attacker can provide a specially crafted, small font file that forces the library to allocate massive amounts of system memory. This can lead to a denial-of-service (DoS) condition where the application or server crashes or becomes unresponsive due to memory exhaustion.
Technical details
A vulnerability exists in `PIL/BdfFontFile.py` within the `bdf_char()` function. When processing a BDF font file, the library reads the `BBX` (bounding box) dimensions and passes them directly to `Image.new()` without performing the standard `_decompression_bomb_check()`. If a BDF glyph contains large dimensions but an empty `BITMAP` section, `Image.frombytes()` fails, and the fallback to `Image.new()` allocates memory on the C-heap based on the attacker-controlled dimensions. An attacker can use this to bypass `MAX_IMAGE_PIXELS` protections and cause a denial-of-service via memory exhaustion. This issue is fixed in Pillow version 12.3.0.
Affected products
- python-pillow Pillow < 12.3.0
Timeline
- 2026-07-03: patched: Fix published in version 12.3.0
- 2026-07-06: advisory: NVD published CVE-2026-55379
- 2026-07-20: disclosed: GitHub Advisory GHSA-45hq-cxwh-f6vc published
References
- https://api.github.com/users/x-forwarded-sudo
- https://github.com/x-forwarded-sudo
- https://api.github.com/users/x-forwarded-sudo/gists%7B/gist_id%7D
- https://api.github.com/users/x-forwarded-sudo/repos
- https://avatars.githubusercontent.com/u/223256873?v=4
- https://api.github.com/users/x-forwarded-sudo/events%7B/privacy%7D