Skip to content

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

High severity GitHub Reviewed Published Dec 10, 2025 in ImageMagick/ImageMagick • Updated Dec 10, 2025

Package

nugetMagick.NET-Q16-AnyCPU (NuGet)

Affected versions

< 14.10.0

Patched versions

14.10.0
nugetMagick.NET-Q16-HDRI-AnyCPU (NuGet)
< 14.10.0
14.10.0
nugetMagick.NET-Q16-HDRI-x86 (NuGet)
< 14.10.0
14.10.0
nugetMagick.NET-Q16-x86 (NuGet)
< 14.10.0
14.10.0
nugetMagick.NET-Q8-AnyCPU (NuGet)
< 14.10.0
14.10.0
nugetMagick.NET-Q8-x86 (NuGet)
< 14.10.0
14.10.0

Description

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

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.

References

@dlemstradlemstra published to ImageMagick/ImageMagick Dec 10, 2025
Published to the GitHub Advisory Database Dec 10, 2025
Reviewed Dec 10, 2025
Last updated Dec 10, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector:More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity:More severe for the least complex attacks.
Privileges required:More severe if no privileges are required.
User interaction:More severe when no user interaction is required.
Scope:More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality:More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity:More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability:More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(8th percentile)

Weaknesses

Out-of-bounds Read

The product reads data past the end, or before the beginning, of the intended buffer. Learn more on MITRE.

CVE ID

CVE-2025-66628

GHSA ID

GHSA-6hjr-v6g4-3fm8

Credits

LoadingChecking history
See something to contribute? Suggest improvements for this vulnerability.