CVE-2025-65955: Withdrawn Advisory: ImageMagick has a use-after-free/double-free risk in Options::fontFamily when clearing family
This advisory was withdrawn on Dec 11, 2025. The publisher no longer considers it a valid vulnerability.
Withdrawn Advisory This advisory has been withdrawn because it does not affect the ImageMagick project's NuGet packages. Original Description We believe that we have discovered a potential security vulnerability in ImageMagick’s Magick++ layer that manifests when Options::fontFamily is invoked with an empty string.
Published Dec 3, 2025 · Updated Dec 11, 2025
Affected packages
Magick.NET-Q16-AnyCPU
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-HDRI-AnyCPU
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-HDRI-OpenMP-arm64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-HDRI-OpenMP-x64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-HDRI-arm64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-HDRI-x64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-HDRI-x86
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-OpenMP-arm64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-OpenMP-x64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-arm64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-x64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q16-x86
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q8-AnyCPU
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q8-OpenMP-arm64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q8-OpenMP-x64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q8-arm64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q8-x64
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Magick.NET-Q8-x86
- Ecosystem
- NuGet
- Affected
- <= 14.9.1
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Withdrawn Advisory
This advisory has been withdrawn because it does not affect the ImageMagick project's NuGet packages.
Original Description
We believe that we have discovered a potential security vulnerability in ImageMagick’s Magick++ layer that manifests when Options::fontFamily is invoked with an empty string.
Vulnerability Details
- Clearing a font family calls
RelinquishMagickMemoryon_drawInfo->font, freeing the font string but leaving_drawInfo->fontpointing to freed memory while_drawInfo->familyis set to that (now-invalid) pointer. Any later cleanup or reuse of_drawInfo->fontre-frees or dereferences dangling memory. DestroyDrawInfoand other setters (Options::font,Image::font) assume_drawInfo->fontremains valid, so destruction or subsequent updates trigger crashes or heap corruption.
if (family_.length() == 0)
{
_drawInfo->family=(char *) RelinquishMagickMemory(_drawInfo->font);
DestroyString(RemoveImageOption(imageInfo(),"family"));
}- CWE-416 (Use After Free):
_drawInfo->fontis left dangling yet still reachable through the Options object. - CWE-415 (Double Free): DrawInfo teardown frees
_drawInfo->fontagain, provoking allocator aborts.
Affected Versions
- Introduced by commit
6409f34d637a34a1c643632aa849371ec8b3b5a8(“Added fontFamily to the Image class of Magick++”, 2015-08-01, blame line 313). - Present in all releases that include that commit, at least ImageMagick 7.0.1-0 and later (likely late 6.9 builds with Magick++ font family support as well). Older releases without
fontFamilyare unaffected.
Command Line Triggerability This vulnerability cannot be triggered from the command line interface. The bug is specific to the Magick++ C++ API, specifically the Options::fontFamily() method. The command-line utilities (such as convert, magick, etc.) do not expose this particular code path, as they operate through different internal mechanisms that do not directly call Options::fontFamily() with an empty string in a way that would trigger the use-after-free condition.
Proposed Fix
diff --git a/Magick++/lib/Options.cpp b/Magick++/lib/Options.cpp
@@ void Magick::Options::fontFamily(const std::string &family_)
- _drawInfo->family=(char *) RelinquishMagickMemory(_drawInfo->font);
+ _drawInfo->family=(char *) RelinquishMagickMemory(_drawInfo->family);This frees only the actual family string, leaving _drawInfo->font untouched. Optionally nulling _drawInfo->font when clearing font() itself maintains allocator hygiene.
Credited to LuiginoC.
References
- https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-q3hc-j9x5-mp9m
- https://nvd.nist.gov/vuln/detail/CVE-2025-65955
- https://github.com/ImageMagick/ImageMagick/commit/6409f34d637a34a1c643632aa849371ec8b3b5a8
- https://github.com/ImageMagick/ImageMagick/commit/6f81eb15f822ad86e8255be75efad6f9762c32f8
- https://github.com/advisories/GHSA-q3hc-j9x5-mp9m
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More NuGet vulnerabilities
All NuGet entriesGHSA-cvhv-g4rq-3hmw
ImageMagick: Memory Leak when providing invalid options to the cli
low3.3Sep 2, 2026CVE-2026-53466
ImageMagick: Heap Buffer Over-Read in XCF decoder due to integer conversion overflow
medium6.5Jul 31, 2026CVE-2026-55510
ImageMagick: Use-After-Free in crafted 8BIM when identifying an image
medium5.5Jul 24, 2026CVE-2026-55594
ImageMagick: Stack Overflow in MVG decoder due to missing depth check.
medium5.3Jul 24, 2026CVE-2026-55595
ImageMagick: Infinite Loop in connected-components when providing invalid arguments
medium4.7Jul 24, 2026CVE-2026-55597
ImageMagick: Heap Buffer Over-Write in JP2 encoder when due to incorrect handling of arguments
medium5.5Jul 24, 2026
