Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
HighPublic exploit

Heap Buffer Overflow in libpng png_image_finish_read

IdentifiersCVE-2025-65018CWE-122· Heap-based Buffer Overflow

CVE-2025-65018 is a heap buffer overflow in libpng’s simplified API read path. In libpng versions 1.6.0 through before 1.6.51, the function png_image_finish_read can write past the end of an allocated heap buffer when processing attacker-crafted 16-bit interlaced PNG images while converting to an 8-bit output format. The flaw is triggered by malformed interlaced PNG input that causes heap writes beyond allocated buffer bounds during image read/finish processing. The issue is described in related context as a malicious PNG heap overflow write associated with row-combination handling, but the specific vulnerable API identified in the provided content is png_image_finish_read. The vulnerability is fixed in libpng 1.6.51.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can cause heap memory corruption in applications that process untrusted PNG images with affected libpng versions. Depending on allocator behavior, surrounding memory layout, and application context, impact can include application crash/denial of service, information disclosure through memory corruption side effects, and potentially arbitrary code execution. Multiple vendor advisories characterize the broader libpng issue set as potentially leading to arbitrary code execution when crafted PNG files are processed.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure by preventing affected applications from processing untrusted or externally supplied PNG files, especially PNGs from web uploads, email attachments, document workflows, or other attacker-controlled sources. Sandbox or isolate image-processing components, enable exploit mitigations provided by the platform, and monitor for crashes or anomalous behavior in services that decode PNG content. These measures are temporary and do not replace upgrading to a fixed libpng release.

Remediation

Patch, then assume compromise.

Upgrade libpng to version 1.6.51 or later. Where vendor-packaged libpng is used, apply the relevant distribution or product security update instead of patching manually. Examples in the provided content include Debian bookworm fixed in 1.6.39-2+deb12u1 and Debian trixie fixed in 1.6.48-1+deb13u1 as part of downstream backports for the libpng vulnerability set; use the vendor-provided fixed package for the affected platform. Validate that all applications statically or dynamically linking libpng are rebuilt or updated as needed.
PUBLIC EXPLOITS

Exploits

2 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 2 / 2 TOTALView more in app
CVE-2025-65018_Exploit_ChallengeMaturityPoCVerified exploit

This repository is a Capture-The-Flag (CTF) style exploit challenge for CVE-2025-65018, a memory corruption vulnerability in libpng's simplified API when handling 16-bit interlaced PNG images. The repository contains: - A vulnerable C binary ('victim.c') that reads a PNG file ('exploit.png') into a stack-allocated buffer, followed by a Logger structure with a function pointer. - A Python script ('solve.py') that generates a malicious PNG file designed to exploit the buffer overflow and overwrite the Logger's function pointer with the address of a 'win' function, which spawns a shell. - Build scripts and a patched version of libpng to ensure the vulnerability is present. The exploit works by carefully crafting the pixel data in the PNG so that, when processed by the vulnerable libpng, it overflows the buffer and overwrites the function pointer. The attack is local, requiring the attacker to supply a crafted PNG file to the vulnerable binary. The repository is well-documented, with detailed explanations in 'Blog.md' and 'README.md', and includes automation for building and testing the exploit. No network endpoints are involved; the main fingerprintable targets are the file paths ('exploit.png', '/bin/sh') and the memory layout of the target binary.

bohemian-miserDisclosed Dec 9, 2025pythonclocal
CVE-2025-65018-Heap-buffer-overflow-in-libpng-ps4-ps5-MaturityPoCVerified exploit

This repository provides a proof-of-concept (PoC) exploit for CVE-2025-65018, a heap buffer overflow vulnerability in libpng as used on PlayStation 4 and PlayStation 5. The repository contains three files: a LICENSE (Apache 2.0), a README.md with usage instructions, and make_png.py, a Python script that modifies a valid PNG screenshot to create a malicious PNG file. The exploit workflow involves taking a screenshot on the PS4/PS5, transferring it to a PC, running the script to generate a crafted PNG, and then replacing the original screenshot on the console. When the crafted PNG is opened in the gallery, it triggers the vulnerability, resulting in an error or crash. The exploit does not provide remote code execution or a shell, but demonstrates the vulnerability by causing a crash. The only fingerprintable endpoint is the file path used for screenshots on the console. The code is a standalone PoC and not part of any exploit framework.

Neo-Neo6Disclosed Nov 23, 2025pythonlocal
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
LibpngLibpngapplication
Rocky LinuxRocky Linuxoperating_system

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures1

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity16

Community discussion across Reddit, Mastodon, and other social sources.

Heap Buffer Overflow in libpng png_image_finish_read (CVE-2025-65018) | Mallory