ImageMagick has Use After Free in MSLStartElement in "coders/msl.c"
Description
ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 7.1.2-15 and 6.9.13-40, a crafted MSL script triggers a heap-use-after-free. The operation element handler replaces and frees the image while the parser continues reading from it, leading to a UAF in ReadBlobString during further parsing. Versions 7.1.2-15 and 6.9.13-40 contain a patch.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A crafted MSL script causes heap-use-after-free in ImageMagick when the operation element handler frees the image while the parser continues reading it.
Vulnerability
Overview
ImageMagick versions prior to 7.1.2-15 and 6.9.13-40 contain a heap-use-after-free vulnerability triggered by a crafted MSL (Magick Scripting Language) script. The root cause is improper handling of the operation element: when a specific MSL script is parsed, the operation handler replaces and frees the image object, but the parser continues to reference the freed memory [2]. This leads to a use-after-free condition specifically in the ReadBlobString function during subsequent parsing [2].
Attack
Vector
An attacker can exploit this vulnerability by supplying a malicious MSL script to ImageMagick. Since ImageMagick is widely used to process user-uploaded images in web applications, graphic design tools, and scientific imaging pipelines, the attack surface includes any service that accepts and processes images [1]. No authentication is required if the application allows unauthenticated image uploads; exploitation can occur remotely by introducing the crafted MSL file [2].
Impact
Successful exploitation could lead to memory corruption, potentially allowing an attacker to read sensitive heap data or execute arbitrary code under the privileges of the ImageMagick process. Given ImageMagick's deployment in server-side environments, this could lead to compromise of the hosting server or disclosure of protected information [1].
Mitigation
The vulnerability is patched in ImageMagick versions 7.1.2-15 and 6.9.13-40 [2]. The fix ensures checks are performed before accessing the image, preventing the parser from reading freed memory [4]. Users should update to the patched versions and review security policies to restrict use of MSL or limit file processing to trusted sources [1].
- GitHub - ImageMagick/ImageMagick: ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms.
- NVD - CVE-2026-25983
- Run checks before accessing the image (GHSA-fwqw-2x5x-w566). · ImageMagick/ImageMagick@257200c
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
Magick.NET-Q16-AnyCPUNuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-HDRI-AnyCPUNuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-HDRI-OpenMP-arm64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-HDRI-OpenMP-x64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-HDRI-arm64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-HDRI-x64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-HDRI-x86NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-OpenMP-arm64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-OpenMP-x64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-OpenMP-x86NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-arm64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-x64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q16-x86NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q8-AnyCPUNuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q8-OpenMP-arm64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q8-OpenMP-x64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q8-arm64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q8-x64NuGet | < 14.10.3 | 14.10.3 |
Magick.NET-Q8-x86NuGet | < 14.10.3 | 14.10.3 |
Affected products
2<7.1.2-15 (or <6.9.13-40)+ 1 more
- (no CPE)range: <7.1.2-15 (or <6.9.13-40)
- (no CPE)range: >= 7.0.0, < 7.1.2-15
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-fwqw-2x5x-w566ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-25983ghsaADVISORY
- github.com/ImageMagick/ImageMagick/commit/257200cb21de23404dce5f8261871845d425dee5ghsaWEB
- github.com/ImageMagick/ImageMagick/security/advisories/GHSA-fwqw-2x5x-w566ghsax_refsource_CONFIRMWEB
- github.com/dlemstra/Magick.NET/releases/tag/14.10.3ghsaWEB
News mentions
0No linked articles in our index yet.