Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40312

CVE-2026-40312: ImageMagick MSL Decoder DoS Vulnerability

CVE-2026-40312 is a denial of service flaw in ImageMagick's MSL decoder caused by an off-by-one error. Malicious MSL files can crash the application. This article covers technical details, affected versions, and mitigation.

Published: April 17, 2026

CVE-2026-40312 Overview

CVE-2026-40312 is an off-by-one error vulnerability in the MSL (Magick Scripting Language) decoder component of ImageMagick, a widely-used open-source software suite for image editing and manipulation. When a maliciously crafted MSL file is processed, this boundary condition error triggers an application crash, resulting in a denial of service condition. The vulnerability affects all ImageMagick versions prior to 7.1.2-19.

Critical Impact

Processing a malicious MSL file can crash the ImageMagick process, causing denial of service conditions in applications that rely on ImageMagick for image processing operations.

Affected Products

  • ImageMagick versions prior to 7.1.2-19
  • Magick.NET versions prior to 14.12.0
  • Applications and services using vulnerable ImageMagick library versions for MSL file processing

Discovery Timeline

  • April 13, 2026 - CVE-2026-40312 published to NVD
  • April 13, 2026 - Last updated in NVD database

Technical Details for CVE-2026-40312

Vulnerability Analysis

This vulnerability is classified as CWE-193 (Off-by-One Error), a common software flaw that occurs when a loop iterates one time too many or too few, or when calculations are off by a single unit. In the context of the MSL decoder, this error manifests in the coders/msl.c file where array index calculations incorrectly reference memory positions.

The attack requires local access to deliver a malicious MSL file to the target system. No user interaction is required once the file reaches an application that processes it with ImageMagick. The vulnerability results in complete availability impact, causing application crashes that can disrupt services dependent on ImageMagick for image processing workflows.

Root Cause

The root cause lies in incorrect array indexing within the MSL decoder's group information handling. Specifically, when incrementing the numImages counter for group information, the code was accessing msl_info->group_info[msl_info->number_groups] instead of the correct msl_info->group_info[msl_info->number_groups-1]. Since arrays in C are zero-indexed, this off-by-one error causes the code to write to a memory location outside the intended bounds when number_groups is non-zero.

Attack Vector

The attack vector requires an adversary to craft a malicious MSL file that triggers the vulnerable code path during parsing. This typically involves:

  1. Creating an MSL file with specific group structure configurations
  2. Delivering the file to a target system through file upload, email attachment, or other file transfer mechanisms
  3. Having the file processed by an application using a vulnerable ImageMagick version

The exploitation is straightforward once the malicious file reaches a vulnerable ImageMagick installation, as no special privileges or user interaction are needed to trigger the crash.

c
// Security patch in coders/msl.c
// Source: https://github.com/ImageMagick/ImageMagick/commit/2a06c7be3bba3326caf8b7a8d1fa2e0d4b88998d

       (msl_info->attributes[n] == (Image *) NULL))
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed")
   if (msl_info->number_groups != 0)
-    msl_info->group_info[msl_info->number_groups].numImages++;
+    msl_info->group_info[msl_info->number_groups-1].numImages++;
   return(n);
 }

The patch corrects the array index by subtracting 1 from number_groups, ensuring the correct zero-indexed array element is accessed.

Detection Methods for CVE-2026-40312

Indicators of Compromise

  • Unexpected ImageMagick process crashes when processing MSL files
  • Core dumps or crash logs indicating segmentation faults in the MSL decoder
  • Presence of unusual or malformed MSL files in upload directories or processing queues

Detection Strategies

  • Monitor application logs for ImageMagick crash events related to MSL file processing
  • Implement file integrity monitoring on ImageMagick binaries to detect version changes
  • Use SentinelOne's Singularity platform to detect anomalous process terminations in image processing workflows
  • Deploy static analysis tools to scan for CVE-2026-40312 in software inventory

Monitoring Recommendations

  • Enable crash reporting and analysis for services utilizing ImageMagick
  • Configure alerting for repeated ImageMagick process restarts or failures
  • Monitor file upload endpoints for suspicious MSL file submissions
  • Track ImageMagick library versions across your environment using software composition analysis tools

How to Mitigate CVE-2026-40312

Immediate Actions Required

  • Upgrade ImageMagick to version 7.1.2-19 or later immediately
  • Update Magick.NET to version 14.12.0 or later if using the .NET wrapper
  • Audit systems for vulnerable ImageMagick installations using package managers or vulnerability scanners
  • Implement input validation to restrict MSL file processing where not explicitly required

Patch Information

ImageMagick has released version 7.1.2-19 which addresses this vulnerability. The fix is available through the official GitHub release. For .NET implementations, the Magick.NET 14.12.0 release includes the patched ImageMagick library. Full details of the vulnerability are documented in the GitHub Security Advisory GHSA-5xg3-585r-9jh5.

Workarounds

  • Disable MSL file processing if not required by your application by configuring ImageMagick policy restrictions
  • Implement strict file type validation to reject MSL files from untrusted sources
  • Use application sandboxing to limit the impact of potential crashes on critical services
  • Consider containerization to isolate ImageMagick processing from core application infrastructure
bash
# Configuration example - Restrict MSL decoder in ImageMagick policy.xml
# Location: /etc/ImageMagick-7/policy.xml

# Add this policy to disable MSL coder:
<policy domain="coder" rights="none" pattern="MSL" />

# Alternative: Restrict all potentially dangerous coders
<policy domain="coder" rights="none" pattern="{MSL,URL,HTTPS,HTTP,FTP}" />

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechImagemagick

  • SeverityMEDIUM

  • CVSS Score6.2

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-193
  • Technical References
  • GitHub Commit Update

  • GitHub Release 7.1.2-19

  • GitHub Security Advisory GHSA-5xg3-585r-9jh5

  • GitHub Magick.NET Release 14.12.0
  • Related CVEs
  • CVE-2026-33908: ImageMagick XML Processing DoS Vulnerability

  • CVE-2026-33535: ImageMagick DoS Vulnerability

  • CVE-2026-31853: ImageMagick SFW Decoder DoS Vulnerability

  • CVE-2026-25985: ImageMagick DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English