Cloudanix VulnDB

CVE-2025-62594

Medium · 4.7

ImageMagick CLAHE : Unsigned underflow and division-by-zero lead to OOB pointer arithmetic and process crash (DoS)

CVSS

4.7

EPSS

0.4%

Published

Oct 27, 2025

CISA due date

—

The record

A single root cause in the CLAHE implementation — tile width/height becoming zero — produces two distinct but related unsafe behaviors. Vulnerabilities exists in the `CLAHEImage()` function of ImageMagick’s `MagickCore/enhance.c`. 1. Unsigned integer underflow → out-of-bounds pointer arithmetic (OOB): when `tile_info.height == 0`, the expression `tile_info.height - 1` (unsigned) wraps to a very large value; using that value in pointer arithmetic yields a huge offset and OOB memory access (leading to memory corruption, SIGSEGV, or resource exhaustion). 2. **Division/modulus by zero**: where code performs `... / tile_info.width` or `... % tile_info.height` without re-checking for zero, causing immediate division-by-zero crashes under sanitizers or `abort` at runtime. Both behaviors are triggered by the same invalid tile condition (e.g., CLI exact `-clahe 0x0!` or automatic tile derivation `dim >> 3 == 0` for very small images). ---

Affected packages

Ecosystem Package Introduced Fixed
NuGet Magick.NET-Q16-HDRI-OpenMP-arm64 0 No fix
NuGet Magick.NET-Q16-HDRI-OpenMP-x64 0 No fix
NuGet Magick.NET-Q16-HDRI-arm64 0 No fix
NuGet Magick.NET-Q16-HDRI-x64 0 No fix
NuGet Magick.NET-Q16-OpenMP-arm64 0 No fix
NuGet Magick.NET-Q16-OpenMP-x64 0 No fix
NuGet Magick.NET-Q16-arm64 0 No fix
NuGet Magick.NET-Q16-x64 0 No fix
NuGet Magick.NET-Q8-OpenMP-arm64 0 No fix
NuGet Magick.NET-Q8-OpenMP-x64 0 No fix
NuGet Magick.NET-Q8-arm64 0 No fix
NuGet Magick.NET-Q8-x64 0 No fix
Chainguard imagemagick-6-dev 0 6.9.13.33-r0
Chainguard imagemagick-6-doc 0 6.9.13.33-r0
Chainguard imagemagick-6-static 0 6.9.13.33-r0
SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 ImageMagick 0 7.1.1.21-150600.3.29.1
SUSE:Linux Enterprise Module for Desktop Applications 15 SP7 ImageMagick 0 7.1.1.43-150700.3.22.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 ImageMagick 0 7.1.1.21-150600.3.29.1
SUSE:Linux Enterprise Module for Development Tools 15 SP7 ImageMagick 0 7.1.1.43-150700.3.22.1
openSUSE:Leap 15.6 ImageMagick 0 7.1.1.21-150600.3.29.1
openSUSE:Leap 16.0 ImageMagick 0 7.1.2.0-160000.4.1
openSUSE:Tumbleweed ImageMagick 0 7.1.2.8-1.1

Related vulnerabilities