CVE-2020-25674 Memory corruption in ImageMagick

Medium 5.5 Published Updated

An out-of-bounds read in ImageMagick's PNG coder can cause a heap-buffer-overflow, leading to application crashes when processing crafted 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-2020-25674?

CVE-2020-25674 is a medium-severity memory corruption vulnerability in Debian Debian Linux, published on 8 Dec 2020. 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

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.

Weakness: CWE-122

Which versions are affected by CVE-2020-25674?

It affects 2 products.

Products include Debian Debian Linux, Imagemagick Imagemagick.

How do I fix CVE-2020-25674?

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-2020-25674 being exploited?

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

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2020-25674, GHSA-28m3-jxqr-cj5w, JLSEC-2026-845, UBUNTU-CVE-2020-25674.

Is CVE-2020-25674 in your software?

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

Check your SBOMs for free