Vulnerability · Published Nov 24, 2025 · Assigned by GitHub_M
CVE-2025-64506LIBPNG is vulnerable to a heap buffer over-read in `png_write_image_8bit` with grayscale+alpha or RGB/RGBA images
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.1% (higher than 4% 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. 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. 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | libpng | 1.6.53-r0 | ALPINE-CVE-2025-64506 |
| Alpine:v3.21 | libpng | 1.6.53-r0 | ALPINE-CVE-2025-64506 |
| Alpine:v3.22 | libpng | 1.6.51-r0 | ALPINE-CVE-2025-64506 |
| Alpine:v3.23 | libpng | 1.6.51-r0 | ALPINE-CVE-2025-64506 |
| Alpine:v3.24 | libpng | 1.6.51-r0 | ALPINE-CVE-2025-64506 |
| Debian:12 | libpng1.6 | 1.6.39-2+deb12u1 | DEBIAN-CVE-2025-64506 |
| Debian:12 | libpng1.6 | 1.6.39-2+deb12u1 | DSA-6076-1 |
| Debian:13 | libpng1.6 | 1.6.48-1+deb13u1 | DEBIAN-CVE-2025-64506 |
| Debian:13 | libpng1.6 | 1.6.48-1+deb13u1 | DSA-6076-1 |
| Debian:14 | libpng1.6 | 1.6.51-1 | DEBIAN-CVE-2025-64506 |
| Ubuntu:22.04:LTS | libpng1.6 | 1.6.37-3ubuntu0.1 | UBUNTU-CVE-2025-64506 |
| Ubuntu:24.04:LTS | libpng1.6 | 1.6.43-5ubuntu0.1 | UBUNTU-CVE-2025-64506 |
| Ubuntu:25.10 | libpng1.6 | 1.6.50-1ubuntu0.1 | UBUNTU-CVE-2025-64506 |
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-qpr4-xm66-hww6 x_refsource_CONFIRM
- https://github.com/pnggroup/libpng/pull/749 x_refsource_MISC
- https://github.com/pnggroup/libpng/commit/2bd84c019c300b78e811743fbcddb67c9d9bf821 x_refsource_MISC