Loading...
Skip to main content

CVE-2025-66628

HIGH

ImageMagick is vulnerable to an integer Overflow in TIM decoder leading to out of bounds read (32-bit only)

Published December 10, 2025Updated May 9, 2026Source: osv

Summary

### 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 `image_size = 2 * width * height` without checking for overflow. On 32-bit systems (or where `size_t` 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); image_size=2*width*height; // 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.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update Magick.NET-Q16-HDRI-x86 to 14.10.0 or later
dotnet add package Magick.NET-Q16-HDRI-x86 --version 14.10.0
NuGet
Update Magick.NET-Q16-x86 to 14.10.0 or later
dotnet add package Magick.NET-Q16-x86 --version 14.10.0
NuGet
Update Magick.NET-Q16-HDRI-AnyCPU to 14.10.0 or later
dotnet add package Magick.NET-Q16-HDRI-AnyCPU --version 14.10.0
NuGet
Update Magick.NET-Q8-AnyCPU to 14.10.0 or later
dotnet add package Magick.NET-Q8-AnyCPU --version 14.10.0
NuGet
Update Magick.NET-Q16-AnyCPU to 14.10.0 or later
dotnet add package Magick.NET-Q16-AnyCPU --version 14.10.0
NuGet
Update Magick.NET-Q8-x86 to 14.10.0 or later
dotnet add package Magick.NET-Q8-x86 --version 14.10.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (6)

PackageEcosystemAffectedFixed In
Magick.NET-Q16-HDRI-x86
nuget
10.0.0, 10.1.0, 11.0.0, 11.1.0 (+199 more)14.10.0
Magick.NET-Q16-x86
nuget
10.0.0, 10.1.0, 11.0.0, 11.1.0 (+218 more)14.10.0
Magick.NET-Q16-HDRI-AnyCPU
nuget
10.0.0, 10.1.0, 11.0.0, 11.1.0 (+199 more)14.10.0
Magick.NET-Q8-AnyCPU
nuget
10.0.0, 10.1.0, 11.0.0, 11.1.0 (+202 more)14.10.0
Magick.NET-Q16-AnyCPU
nuget
10.0.0, 10.1.0, 11.0.0, 11.1.0 (+202 more)14.10.0
Magick.NET-Q8-x86
nuget
10.0.0, 10.1.0, 11.0.0, 11.1.0 (+218 more)14.10.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-125
    Out-of-bounds ReadMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2025-66628?
ImageMagick is vulnerable to an integer Overflow in TIM decoder leading to out of bounds read (32-bit only) This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2025-66628?
CVE-2025-66628 affects Magick.NET-Q16-HDRI-x86, Magick.NET-Q16-x86 and Magick.NET-Q16-HDRI-AnyCPU (and 3 more). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-66628 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-6hjr-v6g4-3fm8

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies