ImageMagick CLAHE : Unsigned underflow and division-by-zero lead to OOB pointer arithmetic and process crash (DoS)
Description
ImageMagick is a software suite to create, edit, compose, or convert bitmap images. ImageMagick versions prior to 7.1.2-8 are vulnerable to denial-of-service due to unsigned integer underflow and division-by-zero in the CLAHEImage function. When tile width or height is zero, unsigned underflow occurs in pointer arithmetic, leading to out-of-bounds memory access, and division-by-zero causes immediate crashes. This issue has been patched in version 7.1.2-8.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
ImageMagick before 7.1.2-8 has a DoS vulnerability in CLAHEImage due to unsigned underflow and division-by-zero when tile dimensions are zero.
Vulnerability
Description
ImageMagick versions prior to 7.1.2-8 contain a denial-of-service vulnerability in the CLAHEImage function located in MagickCore/enhance.c. The root cause is improper handling of tile dimensions: when the tile width or height is zero, an unsigned integer underflow occurs in pointer arithmetic (e.g., tile.height - 1 wrapping to UINT_MAX), leading to out-of-bounds memory access. Additionally, division-by-zero is triggered when code performs modulo or division operations with a zero tile dimension without prior validation [1][2].
Exploitation
An attacker can exploit this vulnerability by supplying a crafted image file that specifies a zero tile size, such as via the -clahe 0x0! command-line option, or by providing a very small image that results in derived tile dimensions of zero. No authentication is required; any application or service that uses ImageMagick to process user-supplied images may be affected. The vulnerability can be triggered remotely if the application processes attacker-controlled images [2].
Impact
Successful exploitation causes a denial-of-service condition: the application may crash due to a segmentation fault (SIGSEGV) from out-of-bounds access or an immediate abort from division-by-zero. Under memory sanitizers, memory corruption may also be detected. The vulnerability does not lead to remote code execution but can be used to disrupt services relying on ImageMagick [1][2][3].
Mitigation
The issue has been patched in ImageMagick version 7.1.2-8. Users should update to this or a later version. The commit 7b47fe369eda90483402fcd3d78fa4167d3bb129 in the official repository contains the fix, which adds validation for tile dimensions and prevents the underflow and division-by-zero conditions [4].
- GitHub - ImageMagick/ImageMagick: ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms.
- CLAHE : Unsigned underflow and division-by-zero lead to OOB pointer arithmetic and process crash (DoS)
- NVD - CVE-2025-62594
- https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-w… · ImageMagick/ImageMagick@7b47fe3
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
Magick.NET-Q16-x64NuGet | <= 14.9.0 | — |
Magick.NET-Q8-x64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-HDRI-x64NuGet | <= 14.9.0 | — |
Magick.NET-Q8-OpenMP-x64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-HDRI-OpenMP-x64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-OpenMP-x64NuGet | <= 14.9.0 | — |
Magick.NET-Q8-arm64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-arm64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-OpenMP-arm64NuGet | <= 14.9.0 | — |
Magick.NET-Q8-OpenMP-arm64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-HDRI-OpenMP-arm64NuGet | <= 14.9.0 | — |
Magick.NET-Q16-HDRI-arm64NuGet | <= 14.9.0 | — |
Affected products
2<7.1.2-8+ 1 more
- (no CPE)range: <7.1.2-8
- (no CPE)range: < 7.1.2-8
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-wpp4-vqfq-v4hpghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-62594ghsaADVISORY
- github.com/ImageMagick/ImageMagick/commit/7b47fe369eda90483402fcd3d78fa4167d3bb129ghsax_refsource_MISCWEB
- github.com/ImageMagick/ImageMagick/security/advisories/GHSA-wpp4-vqfq-v4hpghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.