Use After Free Affecting imagemagick package, versions [0,]


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.32% (25th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-CONAN-IMAGEMAGICK-17954577
  • published12 Jul 2026
  • disclosed11 Jul 2026
  • creditRigelYoung

Introduced: 11 Jul 2026

CVE-2026-61861  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

Affected versions of this package are vulnerable to Use After Free via the FormatMagickCaption function in MagickCore/annotate.c. An attacker can trigger a dangling-pointer dereference by supplying caption text that drives the memory-allocation failure path during caption formatting. When ReplaceSpaceWithNewline(caption, s) fails, FormatMagickCaption continues using the stale s pointer, which still refers to freed memory. This can crash the application while processing the image caption and disrupt any operation that renders or converts the affected image.

Notes

  • The vulnerable path is only reachable during caption formatting when ReplaceSpaceWithNewline(caption, s) returns a replacement buffer; deployments that never exercise caption rendering/annotation through this code path are not exposed.
  • The issue is tied to the memory-failure branch inside FormatMagickCaption, so it depends on an allocation failure while processing the caption text rather than ordinary caption content alone.

CVSS Base Scores

version 4.0
version 3.1