ImageMagick Stack Overflow Vulnerability Due to Circular Reference Mismanagement in MSL Processing

Vulnerability

A stack overflow vulnerability has been identified in ImageMagick versions prior to 7.1.2-15 and 6.9.13-40. The issue arises because the software fails to properly check for circular references between two MSL (Magick Scripting Language) files, leading to a stack overflow condition. This vulnerability can be exploited by creating MSL files that reference each other circularly, causing the application to enter a recursive loop that eventually leads to a stack overflow.

Impact

Exploitation of this vulnerability causes a stack overflow, which can potentially be leveraged to execute arbitrary code or cause a denial-of-service condition by crashing the application.

Reproduction

To reproduce this vulnerability, create two MSL files that reference each other in a circular manner. Then, use ImageMagick to read the first MSL file. The application will process the MSL script, leading to a stack overflow condition. This can be verified by using a tool like AddressSanitizer, which will report the stack overflow error.

Remediation

Users can upgrade to ImageMagick versions 7.1.2-15 or 6.9.13-40, both of which contain the necessary patch to address this vulnerability.

Added: Feb 24, 2026, 2:21 AM
Updated: Feb 24, 2026, 2:21 AM

Vulnerability Rating

Custom Algorithm
spread
7.8
impact
2.5
exploitability
3.6
remediation
7.7
relevance
3.1
threat
1.6
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.