Tetrak
GitHub ↗
Security · Pillow

An IPTC file with no recognisable header drives Image.merge into a null pointer

Pillow: NULL pointer dereference in Image.merge via an unvalidated band 0

Advisory
CVE-2026-112405
Library
Pillow, pillow on PyPI
Published
Severity
not scored upstream
Affected
< 12.3.0
Fixed in
12.3.0
Reaches you
by opening a file

What triggers it

Image.open and load on a crafted IPTC file; the IPTC plugin has no magic-byte check, so any bytes can reach it.

What sillybos does

Refused by default

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

The flaw depends on Pillow trying the IPTC reader on a file with no header to recognise. sillybos names the format from the first bytes and refuses what it cannot name, and open_checked passes Pillow only the JPEG, PNG and TIFF readers, so the IPTC plugin is never tried.

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. Open with formats limited to the readers you mean to use, as open_checked does; a file of any other format is refused before Pillow sees it.

The general advice applies to every row here.

Sources