Tetrak
GitHub ↗
Security · Pillow

A font with huge glyph advances overflows Pillow's position counter

Pillow has an integer overflow when processing fonts

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

What triggers it

Drawing text with a crafted font through ImageFont.

What sillybos does

Refused by default

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

The carrier is a font whose glyphs advance by an enormous amount, loaded through ImageFont and drawn with. 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 ImageFont.

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.2.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