What’s Vulnerable › Vulnerabilities
CVE-2025-65955: ImageMagick has a use-after-free/double-free risk in Options::fontFamily when clearing family
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2025-12-02 · updated 2026-06-23
- Weakness: CWE-415
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.
Affected products
- ImageMagick: before 6.9.13-34; from 7.0.0-0 before 7.1.2-9 — fixed in 6.9.13-34, 7.1.2-9
How to fix
Upgrade to a fixed version: ImageMagick 6.9.13-34, 7.1.2-9. Check the vendor advisory for mitigations.
References
- https://github.com/ImageMagick/ImageMagick/commit/6409f34d637a34a1c643632aa849371ec8b3b5a8
- https://github.com/ImageMagick/ImageMagick/commit/6f81eb15f822ad86e8255be75efad6f9762c32f8
- https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-q3hc-j9x5-mp9m
Get alerted when CVE-2025-65955 or the next vulnerability affects your stack