CVE-2025-64506 LIBPNG is vulnerable to a heap buffer over-read in `png_write_image_8bit` with grayscale+alpha or RGB/RGBA images

Medium 6.1 Published Updated

A heap buffer over-read in libpng allows attackers to cause denial of service or disclose memory contents when processing specific 8-bit images.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-64506?

CVE-2025-64506 is a medium-severity memory corruption vulnerability in Libpng Libpng, published on 24 Nov 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

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.

Weakness: CWE-125

Which versions are affected by CVE-2025-64506?

It affects 1 product.

Products include Libpng Libpng.

How do I fix CVE-2025-64506?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2025-64506 being exploited?

There is no known exploitation of CVE-2025-64506 in the wild and no public exploit code.

All Libpng Libpng vulnerabilities

Sources

Also known as ALPINE-CVE-2025-64506, AZL-70841, AZL-70856, AZL-70871, AZL-70886, AZL-70897 and 12 more.

Is CVE-2025-64506 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free