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

Published Dec 2, 2025
·
Updated

Rejected reason: Further research determined the issue is not a vulnerability.

Other sources

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 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.

cpp if (family.length() == 0) { drawInfo->family=(char ) RelinquishMagickMemory(drawInfo->font); DestroyString(RemoveImageOption(imageInfo(),"family")); }

- CWE-416 (Use After Free): drawInfo->font is left dangling yet still reachable through the Options object. - CWE-415 (Double Free): DrawInfo teardown frees drawInfo->font again, 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 fontFamily are 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 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.

— GitHub

Affected Software

26 affected componentsFixes available
ImageMagick ImageMagick<7.1.2-9
ImageMagick ImageMagick<6.9.13-34
nuget/magick.net-q8-x86<=14.9.1
nuget/magick.net-q8-x64<=14.9.1
nuget/magick.net-q8-arm64<=14.9.1
nuget/magick.net-q8-openmp-x64<=14.9.1
nuget/magick.net-q8-openmp-arm64<=14.9.1
nuget/magick.net-q8-anycpu<=14.9.1
nuget/magick.net-q16-x86<=14.9.1
nuget/magick.net-q16-x64<=14.9.1
nuget/magick.net-q16-arm64<=14.9.1
nuget/magick.net-q16-openmp-x64<=14.9.1
nuget/magick.net-q16-openmp-arm64<=14.9.1
nuget/magick.net-q16-hdri-x86<=14.9.1
nuget/magick.net-q16-hdri-x64<=14.9.1
nuget/magick.net-q16-hdri-arm64<=14.9.1
nuget/magick.net-q16-hdri-openmp-x64<=14.9.1
nuget/magick.net-q16-hdri-openmp-arm64<=14.9.1
nuget/magick.net-q16-hdri-anycpu<=14.9.1
nuget/magick.net-q16-anycpu<=14.9.1
ImageMagick ImageMagick<6.9.13-34
ImageMagick ImageMagick>=7.0.0-0<7.1.2-9
debian/imagemagick<8:6.9.11.60+dfsg-1.6+deb12u5
8:6.9.11.60+dfsg-1.6+deb12u5
debian/imagemagick<8:7.1.1.43+dfsg1-1+deb13u4
8:7.1.1.43+dfsg1-1+deb13u4
debian/imagemagick<8:7.1.2.12+dfsg1-1
8:7.1.2.12+dfsg1-1
debian/imagemagick
8:6.9.11.60+dfsg-1.6+deb12u118:6.9.11.60+dfsg-1.6+deb12u158:7.1.1.43+dfsg1-1+deb13u128:7.1.1.43+dfsg1-1+deb13u148:7.1.2.34+dfsg1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/imagemagick to a version that resolves this vulnerability.

    Fixed in 8:6.9.11.60+dfsg-1.6+deb12u5
  2. Upgrade

    Upgrade debian/imagemagick to a version that resolves this vulnerability.

    Fixed in 8:7.1.1.43+dfsg1-1+deb13u4
  3. Upgrade

    Upgrade debian/imagemagick to a version that resolves this vulnerability.

    Fixed in 8:7.1.2.12+dfsg1-1
  4. Upgrade

    Upgrade debian/imagemagick to a version that resolves this vulnerability.

    Fixed in 8:6.9.11.60+dfsg-1.6+deb12u11Fixed in 8:6.9.11.60+dfsg-1.6+deb12u15Fixed in 8:7.1.1.43+dfsg1-1+deb13u12Fixed in 8:7.1.1.43+dfsg1-1+deb13u14Fixed in 8:7.1.2.34+dfsg1-1
  5. Upgrade

    Upgrade ImageMagick to a version that resolves this vulnerability.

    Fixed in 7.1.2-9
  6. Upgrade

    Upgrade ImageMagick to a version that resolves this vulnerability.

    Fixed in 6.9.13-34

Event History

Dec 2, 2025
CVE Published
via MITRE·11:02 PM
Data Sourced
via MITRE·11:02 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:15 PM
Affected Software
Dec 3, 2025
Advisory Published
via GitHub·04:25 PM
Data Sourced
via GitHub·04:25 PM
DescriptionSeverityWeaknessAffected Software

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-65955?

CVE-2025-65955 has a moderate severity level due to its potential impact on application stability.

2

How do I fix CVE-2025-65955?

To fix CVE-2025-65955, upgrade ImageMagick to version 7.1.2-9 or 6.9.13-34 or later.

3

What versions of ImageMagick are affected by CVE-2025-65955?

CVE-2025-65955 affects ImageMagick versions prior to 7.1.2-9 and 6.9.13-34.

4

What is the nature of the vulnerability in CVE-2025-65955?

CVE-2025-65955 is a vulnerability in ImageMagick's Magick++ layer that occurs when Options::fontFamily is invoked with an empty string.

5

Can CVE-2025-65955 lead to Denial of Service attacks?

Yes, CVE-2025-65955 may lead to Denial of Service conditions due to application crashes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203