CVE-2025-65955 ImageMagick has a use-after-free/double-free risk in Options::fontFamily when clearing family

Medium 4.9 Published Updated

Attackers can trigger a use-after-free in ImageMagick's font handling, causing crashes or potential code execution via crafted image processing.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-65955?

CVE-2025-65955 is a medium-severity use after free vulnerability in Imagemagick Imagemagick, published on 2 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to 7.1.2-9 and 6.9.13-34, there is a vulnerability in ImageMagick’s Magick++ layer that manifests when Options::fontFamily is invoked with an empty string. Clearing a font family calls RelinquishMagickMemory on _drawInfo->font, freeing the font string but leaving _drawInfo->font pointing to freed memory while _drawInfo->family is set to that (now-invalid) pointer. Any later cleanup or reuse of _drawInfo->font re-frees or dereferences dangling memory. DestroyDrawInfo and other setters (Options::font, Image::font) assume _drawInfo->font remains valid, so destruction or subsequent updates trigger crashes or heap corruption. This vulnerability is fixed in 7.1.2-9 and 6.9.13-34.

Weakness: CWE-416, CWE-415

Which versions are affected by CVE-2025-65955?

36 open source packages ship an affected version, including Magick.NET-Q16-AnyCPU, Magick.NET-Q16-HDRI-AnyCPU and Magick.NET-Q16-HDRI-OpenMP-arm64. It affects 1 product.

PackageAffectedFixed in
Magick.NET-Q16-AnyCPU NuGetAll versions to 14.9.1None
Magick.NET-Q16-AnyCPU NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-AnyCPU NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-AnyCPU NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-OpenMP-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-OpenMP-arm64 NuGetAll versions to 14.9.1None
30 more packages
Magick.NET-Q16-HDRI-OpenMP-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-OpenMP-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-x86 NuGetAll versions to 14.9.1None
Magick.NET-Q16-HDRI-x86 NuGetAll versions to 14.9.1None
Magick.NET-Q16-OpenMP-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-OpenMP-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-OpenMP-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-OpenMP-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q16-x86 NuGetAll versions to 14.9.1None
Magick.NET-Q16-x86 NuGetAll versions to 14.9.1None
Magick.NET-Q8-AnyCPU NuGetAll versions to 14.9.1None
Magick.NET-Q8-AnyCPU NuGetAll versions to 14.9.1None
Magick.NET-Q8-OpenMP-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-OpenMP-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-OpenMP-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-OpenMP-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-arm64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-x64 NuGetAll versions to 14.9.1None
Magick.NET-Q8-x86 NuGetAll versions to 14.9.1None
Magick.NET-Q8-x86 NuGetAll versions to 14.9.1None
Linux distribution packages (1)
ImageMagick openSUSE:TumbleweedAll versions7.1.2.10-1.1

Products include Imagemagick Imagemagick.

How do I fix CVE-2025-65955?

Upgrade to a fixed version.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-65955 being exploited?

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

All Imagemagick Imagemagick vulnerabilities

Sources

Also known as DEBIAN-CVE-2025-65955, GHSA-q3hc-j9x5-mp9m, MINI-rp3w-whxc-ccgg, OESA-2025-2791, OESA-2025-2792, OESA-2025-2793 and 4 more.

Is CVE-2025-65955 in your software?

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

Check your SBOMs for free