Vulnerability · Published Nov 24, 2025 · Assigned by GitHub_M
CVE-2025-64505LIBPNG is vulnerable to a heap buffer overflow in `png_do_quantize` via malformed palette index
Medium 6.1
In plain English
A medium-severity out-of-bounds read in libpng from pnggroup. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 11% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | libpng | 1.6.53-r0 | ALPINE-CVE-2025-64505 |
| Alpine:v3.21 | libpng | 1.6.53-r0 | ALPINE-CVE-2025-64505 |
| Alpine:v3.22 | libpng | 1.6.51-r0 | ALPINE-CVE-2025-64505 |
| Alpine:v3.23 | libpng | 1.6.51-r0 | ALPINE-CVE-2025-64505 |
| Alpine:v3.24 | libpng | 1.6.51-r0 | ALPINE-CVE-2025-64505 |
| Debian:12 | libpng1.6 | 1.6.39-2+deb12u1 | DEBIAN-CVE-2025-64505 |
| Debian:12 | libpng1.6 | 1.6.39-2+deb12u1 | DSA-6076-1 |
| Debian:13 | libpng1.6 | 1.6.48-1+deb13u1 | DEBIAN-CVE-2025-64505 |
| Debian:13 | libpng1.6 | 1.6.48-1+deb13u1 | DSA-6076-1 |
| Debian:14 | libpng1.6 | 1.6.51-1 | DEBIAN-CVE-2025-64505 |
| Ubuntu:22.04:LTS | libpng1.6 | 1.6.37-3ubuntu0.1 | UBUNTU-CVE-2025-64505 |
| Ubuntu:24.04:LTS | libpng1.6 | 1.6.43-5ubuntu0.1 | UBUNTU-CVE-2025-64505 |
| Ubuntu:25.10 | libpng1.6 | 1.6.50-1ubuntu0.1 | UBUNTU-CVE-2025-64505 |
Affected products (as reported)
Weakness: CWE-125 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H
References
- https://github.com/pnggroup/libpng/security/advisories/GHSA-4952-h5wq-4m42 x_refsource_CONFIRM
- https://github.com/pnggroup/libpng/pull/748 x_refsource_MISC
- https://github.com/pnggroup/libpng/commit/6a528eb5fd0dd7f6de1c39d30de0e41473431c37 x_refsource_MISC