CVE-2026-23874 — Vulnerability in Magick.NET-Q8-x64 — CVE Details
ImageMagick MSL: Stack overflow via infinite recursion in ProcessMSLScript
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.18%). Schedule for your next planned update.
Does your project use an affected Magick.NET-Q8-x64 version?
Paste your packages.lock.json to check it for CVE-2026-23874 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
Stack overflow via infinite recursion in MSL (Magick Scripting Language) <write> command when writing to MSL format.
Version
- ImageMagick 7.x (tested on current main branch)
- Commit: HEAD
- Requires: libxml2 support (for MSL parsing)
Steps to Reproduce
Method 1: Using ImageMagick directly
magick MSL:recursive.msl out.png
Method 2: Using OSS-Fuzz reproduce
python3 infra/helper.py build_fuzzers imagemagick
python3 infra/helper.py reproduce imagemagick msl_fuzzer recursive.msl
Or run the fuzzer directly:
./msl_fuzzer recursive.msl
Expected Behavior
ImageMagick should handle recursive MSL references gracefully by detecting the loop and returning an error.
Actual Behavior
Stack overflow causes process crash:
AddressSanitizer:DEADLYSIGNAL
==PID==ERROR: AddressSanitizer: stack-overflow
#0 MSLStartElement /src/imagemagick/coders/msl.c:7045
#1 xmlParseStartTag /src/libxml2/parser.c
#2 xmlParseChunk /src/libxml2/parser.c:11273
#3 ProcessMSLScript /src/imagemagick/coders/msl.c:7405
#4 WriteMSLImage /src/imagemagick/coders/msl.c:7867
#5 WriteImage /src/imagemagick/MagickCore/constitute.c:1346
#6 MSLStartElement /src/imagemagick/coders/msl.c:7045
... (infinite recursion, 287+ frames)
Root Cause Analysis
In coders/msl.c, the <write> command handler in MSLStartElement() (line ~7045) calls WriteImage(). When the output filename specifies MSL format (msl:filename), WriteMSLImage() is called, which parses the MSL file again via ProcessMSLScript().
If the MSL file references itself (directly or indirectly), this creates an infinite recursion loop:
MSLStartElement() → WriteImage() → WriteMSLImage() → ProcessMSLScript()
→ xmlParseChunk() → MSLStartElement() → ... (infinite loop)
Impact
- DoS: Guaranteed crash via stack exhaustion
- Affected: Any application using ImageMagick to process user-supplied MSL files
Additional Trigger Paths
The <read> command can also trigger recursion:
Indirect recursion is also possible (a.msl → b.msl → a.msl).
Fuzzer
This issue was discovered using a custom MSL fuzzer:
#include <cstdint>
#include <Magick++/Blob.h>
#include <Magick++/Image.h>
#include "utils.cc"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
{
if (IsInvalidSize(Size))
return(0);
try
{
const Magick::Blob blob(Data, Size);
Magick::Image image;
image.magick("MSL");
image.fileName("MSL:");
image.read(blob);
}
catch (Magick::Exception)
{
}
return(0);
}
This issue was found by Team FuzzingBrain @ Texas A&M University
Advisory Timeline
- First published January 21, 2026 (309 days ago).
- Last revised September 10, 2026 — 232 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
dotnet add package Magick.NET-Q8-x64 --version 14.10.2
dotnet add package Magick.NET-Q16-HDRI-OpenMP-x64 --version 14.10.2
dotnet add package Magick.NET-Q8-AnyCPU --version 14.10.2
dotnet add package Magick.NET-Q16-HDRI-OpenMP-arm64 --version 14.10.2
dotnet add package Magick.NET-Q16-OpenMP-arm64 --version 14.10.2
dotnet add package Magick.NET-Q16-HDRI-arm64 --version 14.10.2
dotnet add package Magick.NET-Q8-x86 --version 14.10.2
dotnet add package Magick.NET-Q16-x86 --version 14.10.2
dotnet add package Magick.NET-Q16-arm64 --version 14.10.2
dotnet add package Magick.NET-Q8-OpenMP-x64 --version 14.10.2
dotnet add package Magick.NET-Q16-HDRI-x64 --version 14.10.2
dotnet add package Magick.NET-Q8-arm64 --version 14.10.2
dotnet add package Magick.NET-Q16-HDRI-x86 --version 14.10.2
dotnet add package Magick.NET-Q8-OpenMP-arm64 --version 14.10.2
dotnet add package Magick.NET-Q16-AnyCPU --version 14.10.2
dotnet add package Magick.NET-Q16-OpenMP-x64 --version 14.10.2
dotnet add package Magick.NET-Q16-x64 --version 14.10.2
dotnet add package Magick.NET-Q16-HDRI-AnyCPU --version 14.10.2
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (18)
Affects 1 ecosystem: NuGet (18).
| Package | Fixed In |
|---|---|
| Magick.NET-Q8-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+220 more) | 14.10.2 |
| Magick.NET-Q16-HDRI-OpenMP-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+101 more) | 14.10.2 |
| Magick.NET-Q8-AnyCPU NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+204 more) | 14.10.2 |
| Magick.NET-Q16-HDRI-OpenMP-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+49 more) | 14.10.2 |
| Magick.NET-Q16-OpenMP-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+49 more) | 14.10.2 |
| Magick.NET-Q16-HDRI-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+49 more) | 14.10.2 |
| Magick.NET-Q8-x86 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+220 more) | 14.10.2 |
| Magick.NET-Q16-x86 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+220 more) | 14.10.2 |
| Magick.NET-Q16-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+49 more) | 14.10.2 |
| Magick.NET-Q8-OpenMP-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+101 more) | 14.10.2 |
| Magick.NET-Q16-HDRI-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+201 more) | 14.10.2 |
| Magick.NET-Q8-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+49 more) | 14.10.2 |
| Magick.NET-Q16-HDRI-x86 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+201 more) | 14.10.2 |
| Magick.NET-Q8-OpenMP-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+49 more) | 14.10.2 |
| Magick.NET-Q16-AnyCPU NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+204 more) | 14.10.2 |
| Magick.NET-Q16-OpenMP-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+101 more) | 14.10.2 |
| Magick.NET-Q16-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+220 more) | 14.10.2 |
| Magick.NET-Q16-HDRI-AnyCPU NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+201 more) | 14.10.2 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-835
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.5 score means for each attack dimension.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
References
Frequently Asked Questions
- What is CVE-2026-23874?
- ImageMagick MSL: Stack overflow via infinite recursion in ProcessMSLScript. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.5/10).
- How do I check if my project is affected by CVE-2026-23874?
- CVE-2026-23874 affects Magick.NET-Q8-x64, Magick.NET-Q16-HDRI-OpenMP-x64 and Magick.NET-Q8-AnyCPU (and 15 more). It has a 0.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-23874 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 4.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2025-55004HIGH
imagemagick: heap-buffer overflow read in MNG magnification with alpha
- CVE-2025-55154HIGH
imagemagick: integer overflows in MNG magnification
- CVE-2025-55160MEDIUM
ImageMagick has Undefined Behavior (function-type-mismatch) in CloneSplayTree
- CVE-2026-30935MEDIUM
ImageMagick has Heap Buffer Over-Read in BilateralBlurImage
- CVE-2023-1289MEDIUM
ImageMagick: Specially crafted SVG leads to segmentation fault and generate trash files in "/tmp", possible to leverage DoS
- CVE-2026-30883MEDIUM
ImageMagick is vulnerable to Heap Overflow when writing extremely large image profile in the PNG encoder
- CVE-2026-26284MEDIUM
ImageMagick: Heap overflow in pcd decoder leads to out of bounds read.
- CVE-2026-56365LOW
ImageMagick has a memory leak in PNG encoder when writing a MNG image