# CVE-2025-65018: LIBPNG is vulnerable to a heap buffer overflow in `png_combine_row` triggered via `png_image_finish_read`

> A heap buffer overflow in libpng allows attackers to execute arbitrary code or cause denial of service via crafted interlaced PNG files.

- **Severity:** High 7.1 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H`)
- **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:** Yes
- **Published:** 24 Nov 2025
- **Updated:** 25 Nov 2025
- **Also known as:** A-463998243, ALPINE-CVE-2025-65018, ASB-A-463998243, AZL-70850, AZL-70853, AZL-70874, AZL-70877, AZL-70891, AZL-70900, AZL-70912, AZL-70925, AZL-70978, BELL-CVE-2025-65018, CLSA-2026-1768394334, CLSA-2026-1768395101, DEBIAN-CVE-2025-65018, ECHO-4a92-1299-0ec1, GHSA-7wv6-48j4-hj3g, JLSEC-2025-331, MINI-52f5-r5pj-382r, ROOT-OS-ALPINE-315-CVE-2025-65018, UBUNTU-CVE-2025-65018, USN-7924-1

## What is CVE-2025-65018?

CVE-2025-65018 is a high-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, there is a heap buffer overflow vulnerability in the libpng simplified API function png_image_finish_read when processing 16-bit interlaced PNGs with 8-bit output format. Attacker-crafted interlaced PNG files cause heap writes beyond allocated buffer bounds. This issue has been patched in version 1.6.51.

Weakness: CWE-787 (Out-of-bounds Write), CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2025-65018?

It affects 1 product.


Products: Libpng Libpng.

## How do I fix CVE-2025-65018?

Upgrade to a fixed version.

## Is CVE-2025-65018 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-65018 exists.

Public exploit code:

- https://github.com/Neo-Neo6/CVE-2025-65018-Heap-buffer-overflow-in-libpng-ps4-ps5- (github_poc): https://github.com/Neo-Neo6/CVE-2025-65018-Heap-buffer-overflow-in-libpng-ps4-ps5-
- https://github.com/bohemian-miser/CVE-2025-65018_Exploit_Challenge (github_poc): https://github.com/bohemian-miser/CVE-2025-65018_Exploit_Challenge

## Other vulnerabilities in Libpng Libpng

- [CVE-2017-12652](https://insights.sbomify.com/CVE-2017-12652/): Denial of service in n/a (critical 9.8)
- [CVE-2018-14550](https://insights.sbomify.com/CVE-2018-14550/): Out-of-bounds write in libpng (high 8.8)
- [CVE-2026-25646](https://insights.sbomify.com/CVE-2026-25646/): LIBPNG has a heap buffer overflow in png_set_quantize (high 8.3)
- [CVE-2026-33636](https://insights.sbomify.com/CVE-2026-33636/): LIBPNG has ARM NEON Palette Expansion Out-of-Bounds Read on AArch64 (high 7.6)
- [CVE-2026-33416](https://insights.sbomify.com/CVE-2026-33416/): LIBPNG has use-after-free via pointer aliasing in `png_set_tRNS` and `png_set_PLTE` (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-65018 and fix it if it is affected.

What it is: CVE-2025-65018 is a high-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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-65018 exists.

Affected product: Libpng Libpng. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-65018/ (Markdown: https://insights.sbomify.com/CVE-2025-65018/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-65018
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-65018
- OSV: https://osv.dev/vulnerability/CVE-2025-65018

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-65018/
Summaries are generated and may contain mistakes; the official description above is the record.
