CVE-2026-61861: ImageMagick before 7.1.2-26 Use-After-Free in FormatMagickCaption
ImageMagick before 7.1.2-26 contains a use-after-free vulnerability in the FormatMagickCaption method when memory allocation fails. Attackers can trigger memory allocation failures to cause a dangling pointer to reference freed memory, potentially enabling denial of service or code execution.
Security readout for executives and security teams
Plain-English summary
ImageMagick, a widely used open-source image processing library, has a memory-handling bug in its caption formatting code. If an attacker can force the system to run low on memory while processing a crafted image, the flaw could crash the service or, in less likely cases, allow malicious code to run. A fixed version is available.
Executive priority
Schedule as a standard patch cycle item unless ImageMagick handles untrusted user uploads or captions, in which case prioritize within the next maintenance window. No known active exploitation, but ImageMagick's broad footprint warrants a deliberate inventory and update.
Technical view
A use-after-free (CWE-416) exists in the FormatMagickCaption method in ImageMagick before 7.1.2-26 and 6.9.13-51. When a memory allocation fails during caption formatting, a dangling pointer references freed memory. Successful triggering requires attacker-controlled input plus induced allocation pressure (CVSS 4.0 6.3, AC:H/AT:P), with denial of service the most plausible outcome and code execution theoretically possible.
Likely exposure
Any service that renders text captions through ImageMagick on user-supplied input is potentially exposed: web upload pipelines, thumbnail and meme generators, PDF/document renderers, and CI image processors. Server-side installations of ImageMagick 6.x before 6.9.13-51 or 7.x before 7.1.2-26 are in scope; embedded copies inside container images and third-party apps are commonly overlooked.
Exploitation context
Not listed in CISA KEV, and no public reports of active exploitation are cited in the source bundle. The CVSS 4.0 vector reflects high attack complexity and an attack-requirement precondition (memory pressure), which limits reliability. The GitHub Security Advisory and VulnCheck advisory describe the flaw but do not indicate in-the-wild abuse as of publication.
Researcher notes
Root cause is a dangling pointer in FormatMagickCaption after an allocation-failure path. Triggering requires inducing OOM conditions during caption formatting, which raises exploitation difficulty. Denial of service is the most credible impact; code execution would require additional heap-shaping primitives not described in the sources. Fixed versions 7.1.2-26 and 6.9.13-51 are called out as unaffected in the CVE record.
Mitigation direction
Upgrade ImageMagick to 7.1.2-26 or 6.9.13-51, or later, across all hosts and container images.
Rebuild and redeploy application images that bundle ImageMagick as a dependency.
Constrain caption/text rendering to trusted inputs and enforce resource limits via policy.xml.
Isolate image processing workers with memory limits and sandboxing to contain crashes.
Monitor vendor advisories (GHSA-qvxh-prvr-85w2, VulnCheck) for any updated fix guidance.
Validation and detection
Run 'magick -version' or 'convert -version' on each host to confirm the patched build.
Inventory container images and language bindings (Wand, RMagick, imagemagick npm) for embedded versions.
Search SBOMs and package manifests for ImageMagick versions below the fixed releases.
Confirm caption/text rendering paths reject or safely handle malformed input under load.
Verify vulnerability scanners have signatures for CVE-2026-61861 and rescan affected assets.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.