CVE-2025-66628: ImageMagick is vulnerable to an Integer Overflow in TIM decoder leading to out of bounds read (32-bit only)

Published Dec 10, 2025
·
Updated

Summary The TIM (PSX TIM) image parser in ImageMagick contains a critical integer overflow vulnerability in the ReadTIMImage function (coders/tim.c). The code reads width and height (16-bit values) from the file header and calculates imagesize = 2 width height without checking for overflow. On 32-bit systems (or where sizet is 32-bit), this calculation can overflow if width and height are large (e.g., 65535), wrapping around to a small value. This results in a small heap allocation via AcquireQuantumMemory and later operations relying on the dimensions can trigger an out of bounds read. Vulnerable Code File: coders/tim.c c width=ReadBlobLSBShort(image); height=ReadBlobLSBShort(image); imagesize=2widthheight; // Line 234 - NO OVERFLOW CHECK!

Impact This vulnerability can lead to Arbitrary Memory Disclosure due to an out of bounds read on 32-bit systems.

Other sources

ImageMagick is a software suite to create, edit, compose, or convert bitmap images. In versions 7.1.2-9 and prior, the TIM (PSX TIM) image parser contains a critical integer overflow vulnerability in its ReadTIMImage function (coders/tim.c). The code reads width and height (16-bit values) from the file header and calculates imagesize = 2 width height without checking for overflow. On 32-bit systems (or where sizet is 32-bit), this calculation can overflow if width and height are large (e.g., 65535), wrapping around to a small value. This results in a small heap allocation via AcquireQuantumMemory and later operations relying on the dimensions can trigger an out of bounds read. This issue is fixed in version 7.1.2-10.

MITRE

Affected Software

7 affected componentsFixes available
nuget/Magick.NET-Q8-x86<14.10.0
14.10.0
nuget/Magick.NET-Q8-AnyCPU<14.10.0
14.10.0
nuget/Magick.NET-Q16-x86<14.10.0
14.10.0
nuget/Magick.NET-Q16-HDRI-x86<14.10.0
14.10.0
nuget/Magick.NET-Q16-HDRI-AnyCPU<14.10.0
14.10.0
nuget/Magick.NET-Q16-AnyCPU<14.10.0
14.10.0
ImageMagick ImageMagick<7.1.2-10

Event History

Dec 10, 2025
Advisory Published
via GitHub·03:47 PM
Data Sourced
via GitHub·03:47 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·10:04 PM
Data Sourced
via MITRE·10:04 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-66628?

CVE-2025-66628 is rated as a critical severity vulnerability due to the potential for integer overflow that could lead to arbitrary code execution.

2

How do I fix CVE-2025-66628?

To fix CVE-2025-66628, upgrade to Magick.NET version 14.10.0 or later.

3

What software is affected by CVE-2025-66628?

CVE-2025-66628 affects multiple Magick.NET packages, including Magick.NET-Q8-x86, Magick.NET-Q16-AnyCPU, and others up to version 14.10.0.

4

What component of ImageMagick is impacted by CVE-2025-66628?

The integer overflow in CVE-2025-66628 is specifically located in the ReadTIMImage function of the TIM image parser.

5

What are the potential consequences of CVE-2025-66628?

Exploitation of CVE-2025-66628 could allow an attacker to execute arbitrary code or cause a denial-of-service condition.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203