ImageMagick
CVE-2025-66628
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted TIM image to 32-bit ImageMagick
-
DeliveryOverflow image_size=2*width*height in ReadTIMImage
-
ExploitUndersized heap allocation via AcquireQuantumMemory
-
ExecutionOut-of-bounds read past buffer
-
ImpactDisclose adjacent heap memory
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires ImageMagick (or a wrapper such as Magick.NET) to parse an attacker-supplied PSX TIM image via the ReadTIMImage code path, AND the binary must be a 32-bit build (or one where size_t is 32-bit) - the advisory explicitly states the overflow does not occur on 64-bit systems. Exploitation is limited by: (1) the 32-bit-only precondition, which excludes the majority of modern 64-bit production deployments; (2) the need for the target to actually process a TIM-format file, which is an uncommon format; (3) impact being confined to memory disclosure with no code execution or crash claimed. No authentication or user interaction is required where a service auto-processes uploaded images. |
| Impact | This is a genuine but low-priority issue. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/C:H/I:N/A:N, base 7.5) rates it High on the strength of a network-reachable, unauthenticated confidentiality breach - appropriate for an image library like ImageMagick that is frequently invoked server-side on attacker-supplied uploads. However, multiple corroborating signals point to modest real-world risk: EPSS is only 0.05% (15th percentile), there is no CISA KEV listing, and no public proof-of-concept exploit is referenced. Most decisively, the GHSA advisory (GHSA-6hjr-v6g4-3fm8) explicitly scopes the integer overflow in ReadTIMImage (coders/tim.c, image_size=2*width*height) to 32-bit systems or builds where size_t is 32-bit; on the 64-bit platforms that dominate modern production deployments the multiplication does not overflow and the flaw is not reachable. The impact is also limited to out-of-bounds READ / memory disclosure (CWE-125) - no integrity or availability impact is claimed - so the 7.5 score is arguably generous for the typical 64-bit environment. Net: a real, patched confidentiality bug worth remediating in the normal patch cycle, but not an emergency, and largely moot outside 32-bit builds. |
| Exploit ScenarioDerived | An attacker crafts a malicious PSX TIM image with large 16-bit width/height header values and submits it to a service (or user) that processes images through ImageMagick on a 32-bit build. The integer overflow in image_size yields an undersized heap allocation, and subsequent dimension-driven operations read past the buffer, disclosing adjacent heap memory. No public exploit code is identified at time of analysis, and the flaw is not exploitable on standard 64-bit deployments. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Sep 25, 2026
An out-of-bounds read in ImageMagick's PSX TIM image decoder allows unauthenticated remote attackers to disclose heap memory contents, but only where the binary is a 32-bit build (or otherwise has a 32-bit size_t). The root cause is an unchecked 'image_size = 2 * width * height' calculation in ReadTIMImage that can wrap to a small value, so an attacker must be able to get the target - ImageMagick itself or a wrapper such as Magick.NET - to parse a hostile TIM file. No public exploit code or active exploitation has been identified, EPSS is negligible (0.05%, 15th percentile), and the independent assessment characterises this as a genuine but low-priority issue: impact is memory disclosure only (no code execution or crash claimed) and the 32-bit precondition excludes most modern 64-bit production deployments. Vendor fixes are available, including Alpine's imagemagick 7.1.2.12-r0 and Magick.NET 14.10.0.
Earlier versions of this analysis (1)
ImageMagick received a security fix in Alpine Linux package version 7.1.2.12-r0, addressing an unspecified vulnerability in the image processing software. The vulnerability details - including attack vector, impact, and root cause - have not been publicly disclosed by the reporter (Alpine Linux vendor). With an EPSS score of 0.05% (15th percentile), exploitation probability is currently very low, and no public exploit or CISA KEV listing has been identified at time of analysis.
RemediationAI
Apply the vendor fixes: Alpine Linux users should upgrade the imagemagick package to 7.1.2.12-r0 or later (apk upgrade imagemagick), .NET consumers of Magick.NET should upgrade to 14.10.0 or later, and upstream ImageMagick builds should move to the release containing the fix referenced by the advisory GHSA-6hjr-v6g4-3fm8 (https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-6hjr-v6g4-3fm8). Because the flaw is confined to 32-bit builds, migrating affected services to a 64-bit ImageMagick binary eliminates the vulnerable code path entirely; this is the most robust compensating control where an immediate upgrade is not possible, with the trade-off of a platform migration rather than a configuration change. Alternatively, disable the TIM coder entirely via an ImageMagick policy.xml entry (a coder policy setting rights="none" for TIM) so hostile TIM files are rejected before ReadTIMImage runs - the trade-off is that legitimate Photoshop/PlayStation TIM images can no longer be processed. Where policies cannot be changed, restrict who can submit images to the processing endpoint (require authentication, cap upload size, or validate content type) to reduce exposure, though this does not fix the underlying defect. Note that patching is the only option that removes the out-of-bounds read rather than avoiding it, and that the referenced Magick.NET commit is an upstream fix for that wrapper while the exact corresponding upstream ImageMagick tagged release for non-Alpine distributions should be confirmed against the linked advisory.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 6 packages in nuget
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability lives in coders/tim.c in ImageMagick's TIM (PlayStation/PSX texture) image parser. ReadTIMImage reads the file's 16-bit little-endian width and height via ReadBlobLSBShort, then computes image_size = 2 * width * height with no overflow check before calling AcquireQuantumMemory to size a heap buffer. With maximum dimensions (e.g. 65535 x 65535), the product is roughly 8.6 billion, which fits in a 64-bit size_t but wraps in a 32-bit size_t, yielding a very small allocation; subsequent decoding operations trust the un-wrapped dimensions and read past the end of the buffer, producing out-of-bounds reads that can leak process memory. The advisory is explicit that the overflow does not occur on 64-bit systems, which is why the CPE range (cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*) is broad but real-world exposure is narrower. The defect is classified CWE-125 (Out-of-Bounds Read), rooted in an integer overflow of the CWE-190 class. Attack surface is any service that automatically processes user-supplied images (thumbnailers, image-conversion APIs, upload pipelines) and is built 32-bit; the managed Magick.NET wrapper is affected because it bundles the native ImageMagick library, with the Q16 and Q16-HDRI AnyCPU and x86 packages fixed in 14.10.0.
Know when Imagemagick gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
AV:N via server-side image processing and PR:N/UI:N for auto-processed uploads, but AC:H because exploitation requires a 32-bit build; only confidentiality (memory disclosure) is affected.
Primary rating from Vendor (vendor:alpine).
CVSS VectorVendor: vendor:alpine
Lifecycle Timeline
2DescriptionCVE.org
Alpine Linux: imagemagick fixed in 7.1.2.12-r0
Executive ViewAI
A memory-disclosure flaw in ImageMagick's TIM image decoder could allow an attacker who can feed a crafted image file to an image-processing service to read small fragments of that process's heap memory, but only where the binary is a 32-bit build. Because the vast majority of production workloads today run 64-bit binaries, the realistic exposure for our image-handling services, build pipelines, and any Magick.NET-based applications is narrow, and no public exploit or active exploitation has been observed. Leadership should care mainly because ImageMagick is a pervasive transitive dependency across our application estate, so a low-severity issue in one component can surface in many teams' inventories and warrants coordinated tracking rather than urgent escalation.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
More in Imagemagick
View allThe (1) EPHEMERAL, (2) HTTPS, (3) MVG, (4) MSL, (5) TEXT, (6) SHOW, (7) WIN, and (8) PLT coders in ImageMagick before 6.
The (1) HTTP and (2) FTP coders in ImageMagick before 6.9.3-10 and 7.x before 7.0.1-1 allow remote attackers to conduct
The EPHEMERAL coder in ImageMagick before 6.9.3-10 and 7.x before 7.0.1-1 allows remote attackers to delete arbitrary fi
ReadGIFImage in coders/gif.c in ImageMagick 7.0.6-1 and GraphicsMagick 1.3.26 leaves the palette uninitialized when proc
Integer overflow in MagickCore/profile.c in ImageMagick before 7.0.2-1 allows remote attackers to cause a denial of serv
The LABEL coder in ImageMagick before 6.9.3-10 and 7.x before 7.0.1-1 allows remote attackers to read arbitrary files vi
The OpenBlob function in blob.c in GraphicsMagick before 1.3.24 and ImageMagick allows remote attackers to execute arbit
The DCM reader in ImageMagick before 6.9.4-5 and 7.x before 7.0.1-7 allows remote attackers to have unspecified impact b
The ReadDCMImage function in DCM reader in ImageMagick before 6.9.4-5 and 7.x before 7.0.1-7 allows remote attackers to
The DCM reader in ImageMagick before 6.9.4-5 and 7.x before 7.0.1-7 allows remote attackers to have unspecified impact b
Unauthenticated attackers can write arbitrary files on a Ruby on Rails host and, when Active Storage uses the Disk servi
ImageMagick 7.0.6-5 has a memory leak vulnerability in ReadWEBPImage in coders/webp.c because memory is not freed in cer
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB