Tetrak
GitHub ↗
Security · Pillow

A negative byte count in an EPS file loops Image.open for ever

Pillow EpsImagePlugin negative %%BeginBinary byte count causes infinite loop denial of service

Advisory
CVE-2026-59203
Library
Pillow, pillow on PyPI
Published
Severity
5.3 out of 10, as published
Affected
>= 12.0.0, <= 12.2.0
Fixed in
12.3.0
Reaches you
by opening a file

What triggers it

Image.open on an EPS file whose %%BeginBinary directive carries a negative byte count; the loop is in Image.open itself, before any load.

What sillybos does

Refused by default

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

A PostScript file is refused by name before Pillow sees it: the first bytes say what it is, whatever its name. This is the EPS reader October's command-execution flaw was also in.

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.

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. Refuse PostScript by name, as sillybos does by default, and never hand Pillow an EPS from outside.

The general advice applies to every row here.

Sources