ImageMagick's MSL: Stack overflow via infinite recursion in ProcessMSLScript
Description
ImageMagick is free and open-source software used for editing and manipulating digital images. Versions prior to 7.1.2-13 have a stack overflow via infinite recursion in MSL (Magick Scripting Language) `` command when writing to MSL format. Version 7.1.2-13 fixes the issue.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
ImageMagick versions prior to 7.1.2-13 are vulnerable to a stack overflow via infinite recursion in the MSL `` command when writing to MSL format, leading to denial of service.
Vulnerability
Overview
CVE-2026-23874 describes a stack overflow vulnerability in ImageMagick, a widely used open-source image processing suite. The flaw resides in the MSL (Magick Scripting Language) parser, specifically within the ` command handler in coders/msl.c. When the command is used to output an image in MSL format, the function WriteMSLImage() is called, which in turn parses the MSL file again via ProcessMSLScript(). If the MSL file contains a self-referential or circular ` directive, this creates an infinite recursion loop, leading to stack exhaustion and a crash [1][2][3].
Exploitation and
Attack Surface
Exploitation requires the attacker to supply a crafted MSL file that triggers the recursive loop. The vulnerability can be triggered by using the magick MSL:recursive.msl out.png command or via fuzzing inputs. No authentication is required if the application processes user-supplied MSL files. The attack surface includes any service or application that uses ImageMagick to handle MSL input, such as web upload handlers, image conversion tools, or automation pipelines [3].
Impact
Successful exploitation results in a denial of service (DoS) due to stack overflow, causing the application to crash. The vulnerability does not appear to allow arbitrary code execution or data exfiltration based on available information. The crash is guaranteed when the recursive condition is met, as demonstrated by AddressSanitizer stack traces showing over 287 recursive frames [3].".
Mitigation
The issue is fixed in ImageMagick version 7.1.2-13 [2][3]. Users should upgrade to this version or later. For environments where immediate patching is not possible, administrators can implement security policies to restrict or disable MSL processing, or validate MSL files before processing. The vulnerability is also addressed in downstream libraries such as Magick.NET 14.10.2 [4].
- 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-23874
- MSL: Stack overflow via infinite recursion in ProcessMSLScript
- Release Magick.NET 14.10.2 · dlemstra/Magick.NET
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-Q8-x64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q8-arm64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q8-x86NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q8-OpenMP-x64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q8-OpenMP-arm64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-x64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-arm64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-x86NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-OpenMP-x64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-OpenMP-arm64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-HDRI-x64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-HDRI-arm64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-HDRI-x86NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-HDRI-OpenMP-x64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-HDRI-OpenMP-arm64NuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q8-AnyCPUNuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-AnyCPUNuGet | < 14.10.2 | 14.10.2 |
Magick.NET-Q16-HDRI-AnyCPUNuGet | < 14.10.2 | 14.10.2 |
Affected products
27.0.1-0, 7.0.1-1, 7.0.1-10, …+ 1 more
- (no CPE)range: 7.0.1-0, 7.0.1-1, 7.0.1-10, …
- (no CPE)range: <7.1.2-13
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-9vj4-wc7r-p844ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-23874ghsaADVISORY
- github.com/ImageMagick/ImageMagick/security/advisories/GHSA-9vj4-wc7r-p844ghsax_refsource_CONFIRMWEB
- github.com/dlemstra/Magick.NET/releases/tag/14.10.2ghsaWEB
News mentions
0No linked articles in our index yet.