CVE-2026-46675: libpng 1.6.59: Use-after-fe vulnerability fixed: CVE-2026-46675
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
Other sources
Use-after-free of zlib input in pngreadend after incomplete zTXt, iTXt or iCCP decompression
— Debian
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/libpng1.6to a version that resolves this vulnerability.Fixed in 1.6.39-2+deb12u6Fixed in 1.6.48-1+deb13u6Fixed in 1.6.59-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.6.59 - Compensating control
For applications using libpng’s sequential read API, read image rows before calling png_read_end.
Event History
Frequently Asked Questions
Which libpng release includes the fix?
The vulnerability is fixed in libpng 1.6.59.