CVE-2025-53101
NoneCVSS
—
EPSS
0.9%
Published
Jul 14, 2025
CISA due date
—
Cloudanix analysis
A flaw in the popular image-editing tool ImageMagick can let specially crafted file names cause crashes or potentially let attackers run their own code when the tool processes images.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Multiple consecutive %d format specifiers in a filename template for the magick mogrify command trigger incorrect pointer arithmetic that computes an address below the stack buffer base, leading to a stack-based buffer overflow during vsnprintf processing.
Why it matters to the business
Organizations relying on ImageMagick for batch image processing or automated pipelines risk application crashes or potential remote code execution when processing untrusted filename templates, which can disrupt media workflows and require emergency patching across development and production environments.
How an attack unfolds
An attacker supplies a crafted filename containing repeated %d specifiers to the mogrify command; the resulting pointer underflow during format string expansion allows vsnprintf to write beyond the intended stack buffer, enabling stack corruption that may be leveraged for code execution in the context of the ImageMagick process.
How to fix it
Upgrade ImageMagick to version 7.1.2-0 or later and 6.9.13-26 or later; for GIT builds apply commits 3fcd081c0278427fc0e8ac40ef75c0a1537792f7 for imagemagick and 363f86d818f807e49269287be9c326f658379685 for imagemagick6; rebuild any dependent packages and test image-processing pipelines with the updated binaries.
How to confirm the fix worked
Verify installed versions report 7.1.2-0 or newer and 6.9.13-26 or newer; execute mogrify with a test template containing repeated %d specifiers and confirm absence of crashes or unexpected memory access; review build logs for the referenced GIT commits.
Typical attack path
- Locate an ImageMagick installation using versions prior to the fixed commits
- Prepare a filename template containing multiple consecutive %d specifiers
- Invoke magick mogrify with the malicious template on a target image
- Trigger the pointer arithmetic error to overflow the stack buffer via vsnprintf
- Attempt to control execution flow through the resulting stack corruption
How to detect it
Review process execution logs and command-line histories for invocations of mogrify or convert containing repeated percent-d sequences; inspect core dumps or crash reports from ImageMagick processes; correlate with file-creation events involving templates that include multiple %d placeholders.
- mogrify.*%d.*%d
- convert.*%d.*%d.*%d
- vsnprintf stack underflow
- ImageMagick.*pointer arithmetic
What your security team should do
- Prioritize immediate upgrade of all ImageMagick instances to the fixed versions or commits
- Scan build and CI systems for references to vulnerable GIT revisions and enforce version pinning
- Monitor EPSS trend and re-evaluate exposure if exploit maturity increases
- Restrict use of mogrify on untrusted filename inputs until patches are deployed
The record
ImageMagick is free and open-source software used for editing and manipulating digital images. In versions prior to 7.1.2-0 and 6.9.13-26, in ImageMagick's `magick mogrify` command, specifying multiple consecutive `%d` format specifiers in a filename template causes internal pointer arithmetic to generate an address below the beginning of the stack buffer, resulting in a stack overflow through `vsnprintf()`. Versions 7.1.2-0 and 6.9.13-26 fix the issue.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| NuGet | Magick.NET-Q16-AnyCPU | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-HDRI-AnyCPU | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-HDRI-OpenMP-arm64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-HDRI-OpenMP-x64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-HDRI-arm64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-HDRI-x64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-HDRI-x86 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-OpenMP-arm64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-OpenMP-x64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-arm64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-x64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q16-x86 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q8-AnyCPU | 0 | 14.7.0 |
| NuGet | Magick.NET-Q8-OpenMP-arm64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q8-OpenMP-x64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q8-arm64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q8-x64 | 0 | 14.7.0 |
| NuGet | Magick.NET-Q8-x86 | 0 | 14.7.0 |
| Chainguard | imagemagick-6 | 0 | 0 |
| Chainguard | imagemagick-6-dev | 0 | 0 |
| Chainguard | imagemagick-6-doc | 0 | 0 |
| Chainguard | imagemagick-6-static | 0 | 0 |
| Debian:11 | imagemagick | 0 | No fix |
| Debian:12 | imagemagick | 0 | No fix |
| Debian:13 | imagemagick | 0 | No fix |
| Debian:14 | imagemagick | 0 | No fix |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 | ImageMagick | 0 | 7.1.0.9-150400.6.33.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 | ImageMagick | 0 | 7.1.1.21-150600.3.13.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP7 | ImageMagick | 0 | 7.1.0.9-150400.6.33.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | ImageMagick | 0 | 7.1.1.21-150600.3.13.1 |
| openSUSE:Leap 15.6 | ImageMagick | 0 | 7.1.1.21-150600.3.13.1 |
| openSUSE:Tumbleweed | ImageMagick | 0 | 7.1.2.0-1.1 |
Related vulnerabilities
- CVE-2026-27799 ImageMagick is free and open-source software used for editing and manipulating digital… Also affects Magick.NET-Q16-AnyCPU
- CVE-2026-27798 ImageMagick is free and open-source software used for editing and manipulating digital… Also affects Magick.NET-Q16-AnyCPU
- GHSA-r99p-5442-q2x2 ImageMagick has a heap Buffer Over-read in its DJVU image format handler Also affects Magick.NET-Q16-AnyCPU
- GHSA-qpgx-jfcq-r59f ImageMagick: Heap Buffer Over-read in WaveletDenoise when processing small images Also affects Magick.NET-Q16-AnyCPU
- GHSA-gq5v-qf8q-fp77 ImageMagick: Heap-based Buffer Overflow in GetPixelIndex due to metadata-cache… Also affects Magick.NET-Q16-AnyCPU
- GHSA-wfx3-6g53-9fgc ImageMagick: Memory Leak in multiple coders that write raw pixel data Also affects Magick.NET-Q16-AnyCPU
- GHSA-3q5f-gmjc-38r8 ImageMagick: Memory leak in coders/txt.c without freetype Also affects Magick.NET-Q16-AnyCPU
- GHSA-xpg8-7m6m-jf56 ImageMagick: SVG-to-MVG Command Injection via coders/svg.c Also affects Magick.NET-Q16-AnyCPU