libpng vulnerabilities
18 known CVE vulnerabilities in libpng, translated and rated.
- CVE-2026-58936Unknown
In png_set_tRNS of pngset.c, there is a possible memory corruption due to a use-after-free. This could lead to remote code execution with no additional execution privileges needed.
- CVE-2026-33636High
In libpng versions 1.6.36 through 1.6.55, the ARM/AArch64 Neon-optimized palette expansion path has an out-of-bounds read and write. When expanding the final partial chunk of an 8-bit paletted row, pointers are dereferenced before the row buffer start and expanded data is written out of bounds, reachable via decoding attacker-controlled PNG input when Neon is enabled. Version 1.6.56 fixes the issue.
- CVE-2026-33416High
In libpng versions 1.2.1 through 1.6.55, `png_set_tRNS` and `png_set_PLTE` each alias a heap-allocated buffer between `png_struct` and `png_info`, sharing a single allocation across two structs with independent lifetimes. Calling `png_free_data` (with `PNG_FREE_TRNS` or `PNG_FREE_PLTE`) frees the buffer through `info_ptr` while the corresponding `png_ptr` pointer remains dangling, and subsequent row-transform functions dereference and in some code paths write to the freed memory. A second call to `png_set_tRNS` or `png_set_PLTE` has the same effect because both functions internally call `png_free_data` before reallocating the `info_ptr` buffer. Version 1.6.56 fixes the issue.
- CVE-2016-10087High
The png_set_text_2 function in libpng before versions 1.0.67, 1.2.57, 1.4.20, 1.5.28, and 1.6.27 allows context-dependent attackers to cause a NULL pointer dereference. This issue occurs when loading a text chunk into a png structure, removing the text, and then adding another text chunk.
- CVE-2016-3751High
Unspecified vulnerability in libpng before version 1.6.20, used in Android 4.x before 4.4.4, 5.0.x before 5.0.2, 5.1.x before 5.1.1, and 6.x before July 1, 2016, allows attackers to gain privileges via a crafted application.
- CVE-2015-8540High
An integer underflow in the png_check_keyword function in pngwutil.c in libpng allows remote attackers to trigger an out-of-bounds read by using a space character as a keyword in a PNG image.
- CVE-2015-8472High
Buffer overflow in the png_set_PLTE function in libpng before version 1.0.65 and in versions 1.1.x, 1.2.x before 1.2.55, 1.3.x, 1.4.x before 1.4.18, 1.5.x before 1.5.25, and 1.6.x before 1.6.20 allows remote attackers to cause application crashes or possibly have unspecified other impacts via a small bit-depth value in an IHDR (image header) chunk in a PNG image.
- CVE-2015-0973High
Buffer overflow in the png_read_IDAT_data function in pngrutil.c in libpng before 1.5.21 and 1.6.x before 1.6.16 allows context-dependent attackers to execute arbitrary code via IDAT data with a large width.
- CVE-2014-9495High
Heap-based buffer overflow in the png_combine_row function in libpng before 1.5.21 and 1.6.x before 1.6.16 may allow context-dependent attackers to execute arbitrary code via a 'very wide interlaced' PNG image on 64-bit systems.
- CVE-2015-8126High
Multiple buffer overflows in the png_set_PLTE and png_get_PLTE functions in libpng before version 1.0.64 and in versions 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, and 1.6.x before their respective versions may allow remote attackers to cause application crashes or potentially other unspecified impacts via a small bit-depth value in an IHDR (image header) chunk in a PNG image.
- CVE-2026-40930Medium
LIBPNG version 1.8.0 has a bug in the push-mode APNG parser: three inter-frame chunk discard paths do not consume the chunk body and CRC, allowing attacker-controlled bytes inside an ignored ancillary chunk to be reinterpreted as a fresh chunk header on the next call to png_process_data.
- CVE-2026-34757Medium
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. From 1.0.9 to before 1.6.57, passing a pointer obtained from png_get_PLTE, png_get_tRNS, or png_get_hIST back into the corresponding setter on the same png_struct/png_info pair causes the setter to read from freed memory and copy its contents into the replacement buffer. The setter frees the internal buffer before copying from the caller-supplied pointer, which now dangles. The freed region may contain stale data (producing silently corrupted chunk metadata) or data from subsequent heap allocations (leaking unrelated heap contents into the chunk struct). This vulnerability is fixed in 1.6.57.
- CVE-2026-25646High
In LIBPNG prior to version 1.6.55, an out-of-bounds read vulnerability exists in the png_set_quantize() function. When called with no histogram and the number of colors in the palette exceeds twice the maximum supported by the display, certain palettes cause an infinite loop reading past the end of a heap buffer. The triggering images are valid per the PNG specification.
- CVE-2025-66293High
LIBPNG is a reference library for reading, creating, and manipulating PNG raster image files. Prior to 1.6.52, an out-of-bounds read vulnerability in libpng's simplified API allows reading up to 1012 bytes beyond the png_sRGB_base[512] array when processing valid palette PNG images with partial transparency and gamma correction. The PNG files that trigger this vulnerability are valid per the PNG specification; the bug is in libpng's internal state management.
- CVE-2025-65018High
LIBPNG from version 1.6.0 to before 1.6.51 has a heap buffer overflow vulnerability in the simplified API function png_image_finish_read when processing 16-bit interlaced PNGs with 8-bit output format. Attacker-crafted interlaced PNG files cause heap writes beyond allocated buffer bounds. The issue is patched in version 1.6.51.
- CVE-2025-64720High
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG raster image files. From version 1.6.0 to before 1.6.51, an out-of-bounds read vulnerability exists in png_image_read_composite when processing palette images with PNG_FLAG_OPTIMIZE_ALPHA enabled. The palette compositing code in png_init_read_transformations incorrectly applies background compositing during premultiplication, violating the invariant component ≤ alpha × 257 required by the simplified PNG API. This issue has been patched in version 1.6.51.
- CVE-2025-64506Medium
From version 1.6.0 to before 1.6.51, a heap buffer over-read vulnerability exists in libpng's png_write_image_8bit function when processing 8-bit images through the simplified write API with convert_to_8bit enabled. A conditional guard incorrectly allows 8-bit input to enter code expecting 16-bit input, causing reads up to 2 bytes beyond allocated buffer boundaries.
- CVE-2025-64505Medium
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG raster image files. Prior to version 1.6.51, a heap buffer over-read vulnerability exists in libpng's png_do_quantize function when processing PNG files with malformed palette indices. The vulnerability occurs when palette_lookup array bounds are not validated against externally-supplied image data, allowing an attacker to craft a PNG file with out-of-range palette indices that trigger out-of-bounds memory access. This issue has been patched in version 1.6.51.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

