# CVE-2020-25674: WriteOnePNGImage() from coders/png.c (the PNG coder) has a for loop with an improper exit condition that can allow an out-of-bounds READ vi…

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.03%, higher than 63% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2020-12-08T00:00:00.000Z
- Modified: 2026-06-17T03:07:06.397Z
- Weaknesses: CWE-122
- Assigned by: redhat

## Description

WriteOnePNGImage() from coders/png.c (the PNG coder) has a for loop with an improper exit condition that can allow an out-of-bounds READ via heap-buffer-overflow. This occurs because it is possible for the colormap to have less than 256 valid values but the loop condition will loop 256 times, attempting to pass invalid colormap data to the event logger. The patch replaces the hardcoded 256 value with a call to MagickMin() to ensure the proper value is used. This could impact application availability when a specially crafted input file is processed by ImageMagick. This flaw affects ImageMagick versions prior to 7.0.8-68.

(As written by CVE List.)

## Affected

- ImageMagick: prior to 7.0.8-68
- imagemagick imagemagick: before 6.9.10-68; from 7.0.0-0 before 7.0.8-68
- debian debian_linux: 9.0

## Every score

- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:N/A:P`

## References

- <https://bugzilla.redhat.com/show_bug.cgi?id=1891928> (exploit, issue-tracking, patch, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2021/01/msg00010.html> (mailing-list, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2023/03/msg00008.html> (mailing-list)

## Sources

- CVE List: [CVE-2020-25674](https://www.cve.org/CVERecord?id=CVE-2020-25674), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2020-25674](https://nvd.nist.gov/vuln/detail/CVE-2020-25674), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2020-25674 · Whole record: https://cve.day/CVE-2020-25674.json · Rebuilt by cve.day 2026-11-25T22:57:56.087Z
