CVE-2026-25983
C# vulnerability analysis and mitigation

Overview

CVE-2026-25983 is a heap-use-after-free vulnerability in ImageMagick's MSL (Magick Scripting Language) decoder, specifically in the MSLStartElement function within coders/msl.c. A crafted MSL script can trigger the flaw when the operation element handler replaces and frees an image object while the parser continues reading from it, resulting in a use-after-free condition in ReadBlobString during further parsing. The vulnerability affects ImageMagick versions prior to 6.9.13-40 (6.x branch) and prior to 7.1.2-15 (7.x branch), as well as Magick.NET NuGet packages prior to version 14.10.3. It was published on February 23–24, 2026. The GitHub Security Advisory rates this as Moderate with a CVSS v3.1 score of 5.3, while Feedly's aggregated data reflects a higher score of 9.8 (Critical) from other sources (GitHub Advisory, Red Hat Bugzilla).

Technical details

The root cause is a use-after-free (CWE-416) combined with an expired pointer dereference (CWE-825) in the MSL decoder's MSLStartElement handler in coders/msl.c. When processing an <operation> element in a crafted MSL script, the handler replaces and frees the current image object; however, the XML parser continues to read from the now-freed memory region, triggering the UAF in the ReadBlobString function during subsequent parsing. Exploitation requires the attacker to supply a malicious MSL script to an ImageMagick instance that processes it — no authentication or user interaction is required, and the attack vector is network-accessible in deployments that accept remote image/script input. The fix is tracked in commit 257200c in the ImageMagick repository (GitHub Advisory, Github Advisory).

Impact

Successful exploitation can result in denial of service through process crash, and potentially information disclosure or arbitrary code execution depending on how the freed memory is reallocated and reused. The primary confirmed impact is availability loss (process termination), but the heap-use-after-free nature of the bug means that in certain memory layout conditions, an attacker could potentially read sensitive data from freed memory or redirect execution flow. Systems that process untrusted MSL scripts or image files via ImageMagick — including web applications, media pipelines, and document converters — are most at risk (GitHub Advisory, Red Hat Bugzilla).

Exploitation steps

  1. Identify target: Locate a service or application that uses a vulnerable version of ImageMagick (< 6.9.13-40 or 7.x < 7.1.2-15) and accepts user-supplied image or script input that is processed via the MSL decoder.
  2. Craft malicious MSL script: Create an MSL script (XML-based) that includes an <operation> element designed to trigger the image replacement and free sequence in MSLStartElement, while additional XML elements follow that cause the parser to continue reading from the freed image pointer.
  3. Deliver the payload: Submit the crafted MSL file to the target application — for example, via a file upload endpoint, an image processing API, or a command-line invocation such as convert malicious.msl output.png.
  4. Trigger the UAF: The MSL parser processes the <operation> element, frees the image, and then calls ReadBlobString on the freed memory during parsing of subsequent elements, triggering the heap-use-after-free.
  5. Achieve objective: Depending on heap state, the outcome ranges from a process crash (denial of service) to potential memory disclosure or code execution if the freed region is reallocated with attacker-controlled data (GitHub Advisory).

Indicators of compromise

  • Process: Unexpected termination or crash of ImageMagick processes (e.g., convert, magick) with heap corruption errors or segmentation faults in logs.
  • Logs: Application or system logs showing ImageMagick aborting with messages referencing ReadBlobString, MSLStartElement, or heap sanitizer output (e.g., AddressSanitizer heap-use-after-free reports) when processing MSL files.
  • File System: Presence of unusual or externally supplied .msl files in upload directories or temporary processing folders.
  • Network: Repeated submission of MSL-formatted content to image processing endpoints, particularly files containing <operation> XML elements followed by additional parsing directives.

Mitigation and workarounds

Upgrade ImageMagick to version 7.1.2-15 or later (7.x branch) or 6.9.13-40 or later (6.x branch). For Magick.NET users, upgrade to version 14.10.3 or later. As a workaround where patching is not immediately possible, disable MSL script processing in ImageMagick's policy configuration (policy.xml) by setting the MSL coder to none, and implement strict input validation to reject .msl files from untrusted sources. Network segmentation to limit which systems can submit files to ImageMagick processing services is also recommended. Distribution-specific patches have been issued by Ubuntu (USN-8069-1), Debian (DSA-6158-1, DSA-6159-1, DLA-4497-1), openSUSE, SUSE, and Amazon Linux 2 (ALAS2-2026-3211) (GitHub Advisory, Red Hat Bugzilla).

Community reactions

The vulnerability was published by maintainer dlemstra via the ImageMagick GitHub Security Advisory program and received moderate attention from the Linux distribution security community, with rapid patch issuance from Ubuntu, Debian, SUSE, openSUSE, and Amazon Linux. Red Hat tracked the issue as medium severity in Bugzilla. No notable independent researcher commentary or significant social media discussion has been identified beyond standard vulnerability aggregator coverage (GitHub Advisory, Red Hat Bugzilla).

Additional resources


SourceThis report was generated using AI

Related C# vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-p5rm-jg5c-8c77MEDIUM6.1
  • C# logoC#
  • Microsoft.OpenApi.Kiota
NoYesJul 24, 2026
CVE-2026-62946MEDIUM5.1
  • C# logoC#
  • Magick.NET-Q16-AnyCPU
NoYesJul 24, 2026
CVE-2026-62363MEDIUM5
  • C# logoC#
  • Magick.NET-Q16-HDRI-OpenMP-arm64
NoYesJul 24, 2026
CVE-2026-62343MEDIUM4.7
  • C# logoC#
  • Magick.NET-Q16-OpenMP-arm64
NoYesJul 24, 2026
GHSA-464c-974j-9xm6LOW3.3
  • JavaScript logoJavaScript
  • @aws-cdk/aws-codebuild
NoYesJul 24, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management