CVE-2026-34757: libpng use-after-free in chunk setter functions

CVE-2026-34757 · Severity: medium · CVSS 5.1 · Published 2026-04-09

libpng is a widely used library for reading and writing PNG image files. A vulnerability exists where certain programming patterns can cause the library to read from memory that has already been cleared, potentially leading to the silent corruption of image data or the accidental exposure of sensitive information from the computer's memory. This issue affects applications that process PNG images using specific library functions.

Technologies: Debian Linux, Libpng. Vendors: Debian, Libpng.

Quick answers

Is CVE-2026-34757 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-34757 being exploited in the wild.
How severe is CVE-2026-34757?
Medium severity, with a CVSS score of 5.1, published 9 April 2026.
Which products and versions are affected?
libpng project libpng 1.0.9 to before 1.6.57.
Is there a fix for CVE-2026-34757?
A patch was published on 2026-03-30: Fixes committed to libpng repository Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-34757 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-34757?
Check whether you run Debian Linux or Libpng. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A use-after-free vulnerability exists in libpng versions 1.0.9 through 1.6.56. The issue occurs when a pointer obtained from a getter function (such as png_get_PLTE, png_get_tRNS, or png_get_hIST) is passed directly back into the corresponding setter function (e.g., png_set_PLTE) for the same png_struct/png_info pair. The setter functions incorrectly free the internal buffer before copying data from the caller-supplied pointer, which then becomes a dangling pointer. This results in the library reading from freed memory, which may contain stale data or contents from subsequent heap allocations, leading to heap information leakage or corrupted chunk metadata. The vulnerability is fixed in version 1.6.57 by snapshotting data before freeing internal storage.

Affected products

  • libpng project libpng 1.0.9 to before 1.6.57

Timeline

  • 2026-03-30: patched: Fixes committed to libpng repository
  • 2026-04-09: disclosed: Initial advisory published
  • 2026-04-09: advisory: NVD published date

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.