Tetrak
GitHub ↗
Security · Pillow

A PCF font's glyph sizes bypass Pillow's decompression-bomb check

Pillow `PcfFontFile._load_bitmaps()`: `Image.frombytes()` called without `_decompression_bomb_check()` — bomb protection bypass via PCF font loading

Advisory
CVE-2026-54059
Library
Pillow, pillow on PyPI
Published
Severity
7.5 out of 10, as published
Affected
< 12.3.0
Fixed in
12.3.0
Reaches you
through another call

What triggers it

Loading a PCF font file through PcfFontFile, which Image.open never does.

What sillybos does

Refused by default

sillybos refuses the triggering file under its default policy, through the format check.

The carrier is a PCF font, read by PcfFontFile, a converter a program imports and calls by name; no image plugin or ImageFont reaches it. Handed to the check, its first bytes are not one of the four formats a scan can be and it is refused as unknown, so the record claims that refusal, though a font is a program's asset that no image check is usually in front of. Neither Tetrak OCR nor sillybos imports it.

Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03. Re-bucketed on 2026-11-03: the file that carries the trigger is one the check refuses, so the record claims it.

Proved by this test in the sillybos suite, which builds the triggering file from bytes and checks that it is refused:

How to protect yourself

In general. Upgrade to Pillow 12.3.0.

Specifically. Load only fonts you ship, never a font from outside; and if a file from outside could be one, run the check on it: a font is refused as unknown.

The general advice applies to every row here.

Sources