Tetrak
GitHub ↗
Security · libpng

Passing a libpng getter's pointer back to its setter reads freed memory

LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files.

Advisory
CVE-2026-34757
Library
libpng, libpng1.6 on Debian
Published
Severity
4.4 out of 10, as published
Affected
libpng 1.0.9 to before 1.6.57
Fixed in
1.6.57
Reaches you
through another call

What triggers it

Calling png_set_PLTE, png_set_tRNS or png_set_hIST with the pointer the matching getter returned.

What sillybos does

Not reached by opening a file

Opening or reading a file never reaches this flaw, so a check before decoding has nothing to refuse. Listed so that nobody expects it to.

A misuse of the setter API by the caller, not a crafted file; Pillow does not do 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.

How to protect yourself

In general. Upgrade to libpng 1.6.57.

Specifically. Not a pre-decode matter: the flaw is in a call that opening a file never makes.

The general advice applies to every row here.

Sources