# CVE-2026-25646: LIBPNG has a heap buffer overflow in png_set_quantize

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

- **Severity:** High 8.3 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Feb 2026
- **Updated:** 1 Sep 2026
- **Also known as:** ALPINE-CVE-2026-25646, ALSA-2026:3031, ALSA-2026:6439, ALSA-2026:6445, AZL-77409, AZL-77441, AZL-77457, AZL-77460, AZL-77463, AZL-77466, AZL-77468, AZL-77471, AZL-77474, AZL-77477, AZL-77480, BELL-CVE-2026-25646, CLEANSTART-2026-LU70983, CLSA-2026-1771839565, CLSA-2026-1771840259, CLSA-2026-1772033549, CLSA-2026-1772146691, CLSA-2026-1772449504, CLSA-2026-1772450608, CLSA-2026-1784715933, DEBIAN-CVE-2026-25646, DSA-6138-1, ECHO-6445-7d7c-0289, GHSA-g8hp-mq4h-rqm3, JLSEC-2026-11, MGASA-2026-0038, MGASA-2026-0096, MINI-f56v-rjc3-6p9r, OESA-2026-1476, RHSA-2026:3031, RHSA-2026:3968, RHSA-2026:3969, RHSA-2026:4221, RHSA-2026:4222, RHSA-2026:4756, RHSA-2026:6439, RHSA-2026:6445, RHSA-2026:6466, RHSA-2026:6467, RHSA-2026:6468, RHSA-2026:6469, RHSA-2026:7032, RHSA-2026:7033, RHSA-2026:7034, RHSA-2026:7035, RHSA-2026:7036, RLSA-2026:3031, RLSA-2026:6439, RLSA-2026:6445, ROOT-OS-ALPINE-315-CVE-2026-25646, RSEC-2026-1, SUSE-SU-2026:0583-1, SUSE-SU-2026:0597-1, SUSE-SU-2026:0598-1, SUSE-SU-2026:0599-1, SUSE-SU-2026:2878-1, SUSE-SU-2026:3039-1, UBUNTU-CVE-2026-25646, USN-8039-1, openSUSE-SU-2026:10188-1, openSUSE-SU-2026:11265-1

## What is CVE-2026-25646?

CVE-2026-25646 is a high-severity memory corruption vulnerability in Libpng Libpng, published on 10 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### 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 1.6.55, an out-of-bounds read vulnerability exists in the png_set_quantize() API function. When the function is called with no histogram and the number of colors in the palette is more than twice the maximum supported by the user's display, certain palettes will cause the function to enter into an infinite loop that reads past the end of an internal heap-allocated buffer. The images that trigger this vulnerability are valid per the PNG specification. This vulnerability is fixed in 1.6.55.

Weakness: CWE-125 (Out-of-bounds Read), CWE-126 (Buffer Over-read), CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2026-25646?

1 open source package ship an affected version, including png. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `png` | CRAN | From 0.1-3 | 0.1-9 |
| `libpng12` | AlmaLinux:8 | All versions | 1.2.57-6.el8_10 |
| `libpng15` | AlmaLinux:8 | All versions | 1.5.30-8.el8_10 |
| `libpng15` | AlmaLinux:9 | All versions | 1.5.30-14.el9_7.1 |
| `libpng12` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.2.57-6.el8_10 |
| `libpng12-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.2.57-6.el8_10 |
| `libpng12-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.2.57-6.el8_10 |
| `libpng15` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.5.30-8.el8_10 |
| `libpng15-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.5.30-8.el8_10 |
| `libpng15-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.5.30-8.el8_10 |
| `libpng15` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.5.30-14.el9_7.1 |
| `libpng15-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.5.30-14.el9_7.1 |
| `libpng15-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.5.30-14.el9_7.1 |
| `libpng12` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.2.57-5.el8_2.1 |
| `libpng15` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.5.30-7.el8_2.1 |
| `libpng15-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.5.30-7.el8_2.1 |
| `libpng15-debugsource` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.5.30-7.el8_2.1 |
| `libpng12` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.2.57-5.el8_4.1 |
| `libpng15` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.5.30-7.el8_4.1 |
| `libpng15-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.5.30-7.el8_4.1 |
| `libpng15-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.5.30-7.el8_4.1 |
| `libpng12` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.2.57-5.el8_6.1 |
| `libpng15` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.5.30-7.el8_6.1 |
| `libpng15-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.5.30-7.el8_6.1 |
| `libpng15-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.5.30-7.el8_6.1 |
| `libpng12` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.2.57-5.el8_6.1 |
| `libpng15` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.5.30-7.el8_6.1 |
| `libpng15-debuginfo` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.5.30-7.el8_6.1 |
| `libpng15-debugsource` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.5.30-7.el8_6.1 |
| `libpng12` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.2.57-5.el8_8.1 |
| `libpng15` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.5.30-7.el8_8.1 |
| `libpng15-debuginfo` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.5.30-7.el8_8.1 |
| `libpng15-debugsource` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.5.30-7.el8_8.1 |
| `libpng15` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:1.5.30-14.el9_0.1 |
| `libpng15-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:1.5.30-14.el9_0.1 |
| `libpng15-debugsource` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:1.5.30-14.el9_0.1 |
| `libpng15` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:1.5.30-14.el9_2.1 |
| `libpng15-debuginfo` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:1.5.30-14.el9_2.1 |
| `libpng15-debugsource` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:1.5.30-14.el9_2.1 |
| `libpng` | Red Hat:rhel_els:7 | All versions | 2:1.5.13-8.el7_9.2 |

Products: Libpng Libpng.

## How do I fix CVE-2026-25646?

Upgrade png to 0.1-9 or later.

## Is CVE-2026-25646 being exploited?

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

## 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-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)
- [CVE-2016-10087](https://insights.sbomify.com/CVE-2016-10087/): Null dereference in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-25646 and fix it if it is affected.

What it is: CVE-2026-25646 is a high-severity memory corruption vulnerability in Libpng Libpng, published on 10 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-25646 exists.

Affected packages and fixed versions:
- png (CRAN): affected from 0.1-3; fixed in 0.1-9

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-2026-25646/ (Markdown: https://insights.sbomify.com/CVE-2026-25646/index.md)
```

## Sources

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

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