The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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-2025-66628

CVE-2025-66628: ImageMagick Buffer Overflow Vulnerability

CVE-2025-66628 is a buffer overflow vulnerability in ImageMagick's TIM parser that allows integer overflow leading to heap corruption. This article covers the technical details, affected versions, impact, and mitigation.

Published: April 29, 2026

CVE-2025-66628 Overview

CVE-2025-66628 is a critical integer overflow vulnerability discovered in ImageMagick's TIM (PSX TIM) image parser. The vulnerability exists in the ReadTIMImage function within coders/tim.c, where the code reads width and height values from a TIM file header and performs an unsafe calculation without proper overflow checking. This flaw allows attackers to craft malicious TIM image files that can trigger out-of-bounds read operations, potentially leading to information disclosure.

Critical Impact

Attackers can exploit this integer overflow to cause heap memory corruption, resulting in out-of-bounds read access that may expose sensitive information from process memory.

Affected Products

  • ImageMagick versions 7.1.2-9 and prior
  • Magick.NET versions using affected ImageMagick core library
  • Applications integrating vulnerable ImageMagick libraries for image processing

Discovery Timeline

  • 2025-12-10 - CVE CVE-2025-66628 published to NVD
  • 2026-01-06 - Last updated in NVD database

Technical Details for CVE-2025-66628

Vulnerability Analysis

The vulnerability stems from an integer overflow condition in ImageMagick's TIM image format parser. When processing TIM files, the ReadTIMImage function extracts 16-bit width and height values from the file header and calculates the image buffer size using the formula image_size = 2 * width * height. This calculation is performed without validating whether the result exceeds the maximum representable value for the size_t type.

On 32-bit systems or environments where size_t is 32 bits, supplying extreme dimension values (such as width and height of 65535) causes the multiplication to overflow and wrap around to a small value. The subsequent memory allocation via AcquireQuantumMemory uses this incorrectly small value, creating an undersized heap buffer. When the parser later attempts to read or write pixel data based on the original dimensions, it accesses memory beyond the allocated buffer boundaries.

The consequence is an out-of-bounds read condition (CWE-125) that can expose sensitive information residing in heap memory adjacent to the undersized buffer.

Root Cause

The root cause is the absence of integer overflow validation when computing the image_size variable in the TIM image decoder. The calculation 2 * width * height uses untrusted input values directly from the file header without bounds checking, making the multiplication susceptible to wraparound on systems with 32-bit size_t. This results in allocating significantly less memory than required for the image dimensions specified.

Attack Vector

An attacker can exploit this vulnerability by crafting a malicious TIM image file with manipulated width and height header values designed to trigger the integer overflow. The attack requires network delivery of the malicious file (as indicated by the network attack vector), where the victim's application processes the file using a vulnerable ImageMagick installation. No authentication or user interaction is required for exploitation.

The attack flow involves:

  1. Creating a TIM file with width and height values that cause integer overflow when multiplied
  2. Delivering the file to a target system running vulnerable ImageMagick
  3. When ImageMagick parses the file, it allocates an undersized buffer
  4. Subsequent pixel data operations trigger out-of-bounds heap reads
  5. Sensitive memory contents may be exposed to the attacker

The vulnerability has been addressed in ImageMagick version 7.1.2-10. The following patch shows the version update in the Magick.NET wrapper:

text
 // <auto-generated/>
-[assembly: System.Reflection.AssemblyTrademark("ImageMagick 7.1.2-10 (Beta)")]
\ No newline at end of file
+[assembly: System.Reflection.AssemblyTrademark("ImageMagick 7.1.2-10")]
\ No newline at end of file

Source: GitHub Commit

Detection Methods for CVE-2025-66628

Indicators of Compromise

  • Presence of TIM image files with unusually large dimension values (width/height approaching 65535)
  • ImageMagick process crashes or abnormal terminations during TIM file processing
  • Memory access violation errors in application logs referencing coders/tim.c or ReadTIMImage
  • Unexpected data exposure or information leakage from applications processing untrusted images

Detection Strategies

  • Monitor for ImageMagick library versions prior to 7.1.2-10 in software inventory scans
  • Implement file upload validation to detect TIM files with suspicious header dimensions
  • Deploy memory protection tools (AddressSanitizer, Valgrind) in testing environments to identify out-of-bounds reads
  • Configure application logging to capture ImageMagick error outputs during image processing operations

Monitoring Recommendations

  • Enable verbose logging for ImageMagick processing operations to capture parsing errors
  • Set up alerts for segmentation faults or memory access violations in services handling image uploads
  • Monitor network traffic for delivery of TIM format files from untrusted sources
  • Track ImageMagick process resource consumption for anomalies indicating exploitation attempts

How to Mitigate CVE-2025-66628

Immediate Actions Required

  • Upgrade ImageMagick to version 7.1.2-10 or later immediately
  • If using Magick.NET, update to the latest version that includes the patched ImageMagick core
  • Disable TIM format processing in ImageMagick policy if not required for business operations
  • Implement input validation on image dimensions before processing with ImageMagick

Patch Information

The vulnerability has been fixed in ImageMagick version 7.1.2-10. The fix adds proper integer overflow checking for the image size calculation in the TIM parser. Organizations should upgrade to this version or later to remediate the vulnerability.

Refer to the GitHub Security Advisory for official patch details and upgrade instructions.

Workarounds

  • Restrict TIM format support in ImageMagick's policy.xml configuration file by denying TIM coder access
  • Process untrusted images in sandboxed environments with limited memory access permissions
  • Implement pre-processing validation that rejects TIM files with dimension values exceeding safe thresholds
  • Use application-level whitelisting to only allow necessary image formats
bash
# ImageMagick policy.xml configuration to disable TIM format processing
# Add to /etc/ImageMagick-7/policy.xml or equivalent location

# Disable TIM coder to prevent vulnerability exploitation
<policy domain="coder" rights="none" pattern="TIM" />

# Alternative: Restrict all image dimensions to prevent overflow
<policy domain="resource" name="width" value="16KP" />
<policy domain="resource" name="height" value="16KP" />

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechImagemagick

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-125
  • Vendor Resources
  • GitHub Security Advisory

  • GitHub Commit Reference
  • Related CVEs
  • CVE-2026-40310: ImageMagick Buffer Overflow Vulnerability

  • CVE-2026-40183: ImageMagick Buffer Overflow Vulnerability

  • CVE-2026-40169: ImageMagick Buffer Overflow Vulnerability

  • CVE-2026-34238: ImageMagick Buffer Overflow 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