See how libpng compares to other vendors in security performance
802.1X. An authentication issue was addressed with improved state management.
In pngimagefinishread of pngrtran.c, there is a possible out of bounds read due to a buffer overflow. This could lead to local denial of service with no additional execution privileges needed. User interaction is not needed for exploitation.
In multiple locations, there is a possible way to achieve remote code execution due to a heap buffer overflow. This could lead to remote escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.
In pngdoexpandpalettergba8neon of paletteneonintrinsics.c, there is a possible out of bounds read and write due to an incorrect bounds check. This could lead to remote escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.
Last updated 18 August 2026
LIBPNG has an integer truncation causing heap buffer over-read in pngimagewrite
LIBPNG has an out-of-bounds read in pngimagereadcomposite
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. In versions 1.2.1 through 1.6.55, pngsettRNS and pngsetPLTE each alias a heap-allocated buffer between pngstruct and pnginfo, sharing a single allocation across two structs with independent lifetimes. The transalpha aliasing has been present since at least libpng 1.0, and the palette aliasing since at least 1.2.1. Both affect all prior release lines pngsettRNS sets pngptr->transalpha = infoptr->transalpha (256-byte buffer) and pngsetPLTE sets infoptr->palette = pngptr->palette (768-byte buffer). In both cases, calling pngfreedata (with PNGFREETRNS or PNGFREEPLTE) frees the buffer through infoptr while the corresponding pngptr pointer remains dangling. Subsequent row-transform functions dereference and, in some code paths, write to the freed memory. A second call to pngsettRNS or pngsetPLTE has the same effect, because both functions call pngfreedata internally before reallocating the infoptr buffer. Version 1.6.56 fixes the issue.
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. In versions 1.2.1 through 1.6.55, pngsettRNS and pngsetPLTE each alias a heap-allocated buffer between pngstruct and pnginfo, sharing a single allocation across two structs with independent lifetimes. The transalpha aliasing has been present since at least libpng 1.0, and the palette aliasing since at least 1.2.1. Both affect all prior release lines pngsettRNS sets pngptr->transalpha = infoptr->transalpha (256-byte buffer) and pngsetPLTE sets infoptr->palette = pngptr->palette (768-byte buffer). In both cases, calling pngfreedata (with PNGFREETRNS or PNGFREEPLTE) frees the buffer through infoptr while the corresponding pngptr pointer remains dangling. Subsequent row-transform functions dereference and, in some code paths, write to the freed memory. A second call to pngsettRNS or pngsetPLTE has the same effect, because both functions call pngfreedata internally before reallocating the infoptr buffer. Version 1.6.56 fixes the issue.
Last updated 18 August 2026
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 pnggetPLTE, pnggettRNS, or pnggethIST back into the corresponding setter on the same pngstruct/pnginfo 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.
A use-after-free vulnerability was discovered in the pngimagefree function in the libpng library. This could lead to denial of service or a potentially exploitable crash when a malformed image is processed.
In libpng 1.6.34, a wrong calculation of rowfactor in the pngcheckchunklength function (pngrutil.c) may trigger an integer overflow and resultant divide-by-zero while processing a crafted PNG file, leading to a denial of service.
A flaw was found in the checkchunkname() function of pngcheck-2.4.0. An attacker able to pass a malicious file to be processed by pngcheck could cause a temporary denial of service, posing a low risk to application availability.
A global buffer overflow was discovered in pngcheck function in pngcheck-2.4.0(5 patches applied) via a crafted png file.
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. From 1.6.51 to 1.6.53, there is a heap buffer over-read in the libpng simplified API function pngimagefinishread when processing interlaced 16-bit PNGs with 8-bit output format and non-minimal row stride. This is a regression introduced by the fix for CVE-2025-65018. This vulnerability is fixed in 1.6.54.
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. From version 1.6.0 to before 1.6.51, a heap buffer over-read vulnerability exists in libpng's pngwriteimage8bit function when processing 8-bit images through the simplified write API with convertto8bit enabled. The vulnerability affects 8-bit grayscale+alpha, RGB/RGBA, and images with incomplete row data. 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. This issue has been patched in version 1.6.51.
A use-after-free vulnerability was found in libpng's sequential reader (versions 1.6.0 through 1.6.58). When an application calls pngreadend after pngreadinfo without first reading image rows, crafted zTXt, iTXt, or iCCP chunks can cause libpng to abandon decompression while zlib still expects more input, leaving a stale pointer and non-zero input count in the zlib stream. When pngreadend runs, it resumes decompression from that dangling pointer.
Two variants exist: 1. Heap use-after-free (zTXt/iTXt): The stale pointer references libpng's chunk read buffer. If a subsequent chunk requires more space, the buffer gets freed, and the later read becomes a heap use-after-free. 2. Stack use-after-return (iCCP): The pointer references local arrays of pnghandleiCCP, resulting in a stack use-after-return read.
Decompression can be abandoned due to invalid window size in the zlib header, decompressed data exceeding libpng's size limit, or an ICC profile that fails validation.
The dangling pointer is read-only; decompressed bytes go to a discarded scratch buffer, so no data is disclosed or corrupted. The worst outcome is a crash when freed heap memory is inaccessible.
Applications are vulnerable if they use the sequential read API and call pngreadend before any of pngreadupdateinfo, pngstartreadimage, pngreadrow, pngreadrows, or pngreadimage. Applications that read image rows before calling pngreadend, or use pngreadpng, the simplified API (pngimage), or the progressive reader (pngprocessdata) are not affected.
Upstream advisory: https://github.com/pnggroup/libpng/security/advisories/GHSA-qvg3-h654-xq3j Upstream fix: https://github.com/pnggroup/libpng/commit/aa77ef38c17ab2fc1b41bec09fb973c6a386641d
A use-after-free vulnerability was found in libpng's sequential reader (versions 1.6.0 through 1.6.58). When an application calls pngreadend after pngreadinfo without first reading image rows, crafted zTXt, iTXt, or iCCP chunks can cause libpng to abandon decompression while zlib still expects more input, leaving a stale pointer and non-zero input count in the zlib stream. When pngreadend runs, it resumes decompression from that dangling pointer.
Two variants exist: 1. Heap use-after-free (zTXt/iTXt): The stale pointer references libpng's chunk read buffer. If a subsequent chunk requires more space, the buffer gets freed, and the later read becomes a heap use-after-free. 2. Stack use-after-return (iCCP): The pointer references local arrays of pnghandleiCCP, resulting in a stack use-after-return read.
Decompression can be abandoned due to invalid window size in the zlib header, decompressed data exceeding libpng's size limit, or an ICC profile that fails validation.
The dangling pointer is read-only; decompressed bytes go to a discarded scratch buffer, so no data is disclosed or corrupted. The worst outcome is a crash when freed heap memory is inaccessible.
Applications are vulnerable if they use the sequential read API and call pngreadend before any of pngreadupdateinfo, pngstartreadimage, pngreadrow, pngreadrows, or pngreadimage. Applications that read image rows before calling pngreadend, or use pngreadpng, the simplified API (pngimage), or the progressive reader (pngprocessdata) are not affected.
Upstream advisory: https://github.com/pnggroup/libpng/security/advisories/GHSA-qvg3-h654-xq3j Upstream fix: https://github.com/pnggroup/libpng/commit/aa77ef38c17ab2fc1b41bec09fb973c6a386641d
Buffer overflow vulnerabilities in functions pnggetPLTE/pngsetPLTE, allowing remote attackers to cause DoS to application or have unspecified other impact. These functions failed to check for an out-of-range palette when reading or writing PNG files with a bitdepth less than 8. Some applications might read the bit depth from the IHDR chunk and allocate memory for a 2^N entry palette, while libpng can return a palette with up to 256 entries even when the bit depth is less than 8.
Affected versions of libpng are before 1.0.64, 1.1.x and 1.2.x before 1.2.54, 1.3.x and 1.4.x before 1.4.17, 1.5.x before 1.5.24, and 1.6.x before 1.6.19.
Upstream patches:
https://github.com/glennrp/libpng/commit/81f44665cce4cb1373f049a76f3904e981b7a766 https://github.com/glennrp/libpng/commit/a901eb3ce6087e0afeef988247f1a1aa208cb54d https://github.com/glennrp/libpng/commit/1bef8e97995c33123665582e57d3ed40b57d5978 https://github.com/glennrp/libpng/commit/83f4c735c88e7f451541c1528d8043c31ba3b466 https://github.com/glennrp/libpng/commit/9f2ad4928e47036cf1ac9b8fe45a491f15be2324
CVE assignment:
http://seclists.org/oss-sec/2015/q4/264
Sam James <sam () gentoo org> writes: Cosmin Truta <ctruta () gmail com> writes: Hello, everyone, Hi Cosmin, libpng 1.6.59 has been released, fixing a medium-severity use-after-free vulnerability in the sequential reader, present since libpng 1.6.0. It affects applications that call pngreadend without first starting to read the image rows.
Users should either upgrade to libpng 1.6.59 or apply the fix described below.
[...] I can't find a tarball for libpng-1.6.59 in the usual places: https://sourceforge.net/projects/libpng/files/libpng16/ has no 1.6.59 dir and http://libpng.download/src linked from the README in the repo has no recent releases. Hanno pointed out the tarball is there now, thanks. Is there a plan to make an official tarball available, or to use the GitHub autogenerated ones going forward? The latter is unfortunate if so because they're not guaranteed to be stable (and can't be signed, though libpng releases aren't signed at the moment; was going to file a bug asking about that). Any thoughts on this though? Cheers! sam
Buffer overflow in the pngreadIDATdata 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, a different vulnerability than CVE-2014-9495.
Unspecified vulnerability in libpng before 1.6.20, as 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 2016-07-01, allows attackers to gain privileges via a crafted application, as demonstrated by obtaining Signature or SignatureOrSystem access, aka internal bug 23265085.
Cosmin Truta <ctruta () gmail com> writes: Hello, everyone, Hi Cosmin, libpng 1.6.59 has been released, fixing a medium-severity use-after-free vulnerability in the sequential reader, present since libpng 1.6.0. It affects applications that call pngreadend without first starting to read the image rows.
Users should either upgrade to libpng 1.6.59 or apply the fix described below.
[...] I can't find a tarball for libpng-1.6.59 in the usual places: https://sourceforge.net/projects/libpng/files/libpng16/ has no 1.6.59 dir and http://libpng.download/src linked from the README in the repo has no recent releases.
Is there a plan to make an official tarball available, or to use the GitHub autogenerated ones going forward? The latter is unfortunate if so because they're not guaranteed to be stable (and can't be signed, though libpng releases aren't signed at the moment; was going to file a bug asking about that).
Cheers! sam
Hello, everyone,
libpng 1.6.59 has been released, fixing a medium-severity use-after-free vulnerability in the sequential reader, present since libpng 1.6.0. It affects applications that call pngreadend without first starting to read the image rows.
Users should either upgrade to libpng 1.6.59 or apply the fix described below.
=== CVE-2026-46675 ===
Use-after-free of zlib input in pngreadend after incomplete zTXt, iTXt or iCCP decompression
Security advisory: https://github.com/pnggroup/libpng/security/advisories/GHSA-qvg3-h654-xq3j
Fix: https://github.com/pnggroup/libpng/commit/aa77ef38c17ab2fc1b41bec09fb973c6a386641d
CVSS 3.1: 5.9 (Medium) - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H CWE: CWE-416 (Use After Free), CWE-825 (Expired Pointer Dereference) Affected: libpng 1.6.0 through 1.6.58 Fixed: libpng 1.6.59
A crafted zTXt, iTXt or iCCP chunk can make libpng abandon decompression while zlib still expects more input: for example, with an invalid window size in the zlib header, with decompressed data too large for libpng to accept, or with an ICC profile that fails validation. The chunk handlers released the zlib stream without clearing its input pointer and count. If the application then calls pngreadend after pngreadinfo, without first starting to read the image rows, pngreadend resumes decompression from that stale pointer instead of reading the IDAT data.
- zTXt and iTXt: the pointer refers to libpng's chunk read buffer, which a later, larger chunk before IDAT (tEXt or pCAL, for example) frees and reallocates; the read is a heap use-after-free. - iCCP: the pointer refers to local arrays of pnghandleiCCP; the read is a stack use-after-return.
Impact: - The dangling pointer is only read, and the decompressed bytes go to a scratch buffer that is discarded, so no data is disclosed or corrupted. - The worst outcome is a crash in the heap variant, when the freed memory is no longer mapped at the time of the read. - The affected call sequence is rare in practice: pngreadend called this way parses the unread image data as chunks, and fails with a libpng error on well-formed files; the stale read happens before that error.
Workaround: Do not call pngreadend when the image rows are not read. If the chunks after the image data are needed, call pngstartreadimage before pngreadend. Whether upgraded or not, applications that call pngreadend without reading the image rows should be prepared to handle a libpng error from it.
Credits: - Ze Sheng, O2Lab and AISLE - @JasonHonKL (independent report of the iCCP variant)
=== References ===
- Release: https://github.com/pnggroup/libpng/releases/tag/v1.6.59 - Independent report: https://github.com/pnggroup/libpng/issues/855 - libpng homepage: http://www.libpng.org/pub/png/libpng.html
--- Cosmin Truta libpng maintainer
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. Prior to 1.6.55, an out-of-bounds read vulnerability exists in the pngsetquantize() API function. When the function is called with no histogram and the number of colors in the palette is more than twice the maximum supported by the user's display, certain palettes will cause the function to enter into an infinite loop that reads past the end of an internal heap-allocated buffer. The images that trigger this vulnerability are valid per the PNG specification. This vulnerability is fixed in 1.6.55.
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. In versions 1.6.36 through 1.6.55, an out-of-bounds read and write exists in libpng's ARM/AArch64 Neon-optimized palette expansion path. When expanding 8-bit paletted rows to RGB or RGBA, the Neon loop processes a final partial chunk without verifying that enough input pixels remain. Because the implementation works backward from the end of the row, the final iteration dereferences pointers before the start of the row buffer (OOB read) and writes expanded pixel data to the same underflowed positions (OOB write). This is reachable via normal decoding of attacker-controlled PNG input if Neon is enabled. Version 1.6.56 fixes the issue.
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 pnggetPLTE, pnggettRNS, or pnggethIST back into the corresponding setter on the same pngstruct/pnginfo 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.
Buffer Overflow vulnerability in libpng 1.6.43-1.6.46 allows a local attacker to cause a denial of service via pngcreatereadstruct() function.
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. Prior to 1.6.55, an out-of-bounds read vulnerability exists in the pngsetquantize() API function. When the function is called with no histogram and the number of colors in the palette is more than twice the maximum supported by the user's display, certain palettes will cause the function to enter into an infinite loop that reads past the end of an internal heap-allocated buffer. The images that trigger this vulnerability are valid per the PNG specification. This vulnerability is fixed in 1.6.55.