CVE-2025-62594
Medium · 4.7ImageMagick 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
- GHSA-wpp4-vqfq-v4hp ImageMagick CLAHE : Unsigned underflow and division-by-zero lead to OOB pointer… Same vulnerability
- CVE-2026-27799 ImageMagick is free and open-source software used for editing and manipulating digital… Also affects Magick.NET-Q16-HDRI-OpenMP-arm64
- CVE-2026-27798 ImageMagick is free and open-source software used for editing and manipulating digital… Also affects Magick.NET-Q16-HDRI-OpenMP-arm64
- GHSA-r99p-5442-q2x2 ImageMagick has a heap Buffer Over-read in its DJVU image format handler Also affects Magick.NET-Q16-HDRI-OpenMP-arm64
- GHSA-qpgx-jfcq-r59f ImageMagick: Heap Buffer Over-read in WaveletDenoise when processing small images Also affects Magick.NET-Q16-HDRI-OpenMP-arm64
- GHSA-gq5v-qf8q-fp77 ImageMagick: Heap-based Buffer Overflow in GetPixelIndex due to metadata-cache… Also affects Magick.NET-Q16-HDRI-OpenMP-arm64
- GHSA-wfx3-6g53-9fgc ImageMagick: Memory Leak in multiple coders that write raw pixel data Also affects Magick.NET-Q16-HDRI-OpenMP-arm64
- GHSA-3q5f-gmjc-38r8 ImageMagick: Memory leak in coders/txt.c without freetype Also affects Magick.NET-Q16-HDRI-OpenMP-arm64