Summary
Passing a geometry string containing only a colon (":") to montage -geometry leads GetGeometry() to set width/height to 0. Later, ThumbnailImage() divides by these zero dimensions, triggering a crash (SIGFPE/abort), resulting in a denial of service.
Details
Root Cause
montage -geometry ":" ...reachesMagickCore/geometry.c:GetGeometry().StringToDouble/InterpretLocaleValueparses":"as0.0;then:
https://github.com/ImageMagick/ImageMagick/blob/0ba1b587be17543b664f7ad538e9e51e0da59d17/MagickCore/geometry.c#L355WidthValue(and/orHeightValue)is set with a zero dimension.- In MagickCore/resize.c:ThumbnailImage(), the code computes:
https://github.com/ImageMagick/ImageMagick/blob/0ba1b587be17543b664f7ad538e9e51e0da59d17/MagickCore/resize.c#L4625-L4629
causing a division by zero and immediate crash.
The issue is trivially triggerable without external input files (e.g., using xc:white).
Reproduction
Environment
Version: ImageMagick 7.1.2-1 (Beta) Q16-HDRI x86_64 0ba1b587b:20250812 https://imagemagick.org
Features: Cipher DPC HDRI
Delegates (built-in): bzlib fontconfig freetype jbig jng jpeg lcms lzma pangocairo png tiff x xml zlib
Compiler: clang (14.0.0)
OS/Arch: Linux x86_64
Steps
./bin/magick montage -geometry : xc:white null:
Observed result
IOT instruction (core dumped)
# (Environment-dependent: SIGFPE/abort may be observed.)
PoC
No external file required; the pseudo image xc:white suffices:
./bin/magick montage -geometry : xc:white null:
Credits
Team Daemon Fuzz Hunters
Bug Hunting Master Program, HSpace/Findthegap
Woojin Park
@jin-156
[email protected]
Hojun Lee
@leehohojune
[email protected]
Youngin Won
@amethyst0225
[email protected]
Siyeon Han
@hanbunny
[email protected]
Impact
- Denial of Service: A divide-by-zero in
ThumbnailImage()causes immediate abnormal termination (e.g., SIGFPE/abort), crashing the ImageMagick process.
CVE-2025-55212 has a CVSS score of 3.7 (Low). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (14.8.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Defensively reject zero dimensions early in ThumbnailImage():
if ((columns == 0) || (rows == 0)) {
(void) ThrowMagickException(exception, GetMagickModule(), OptionError,
"InvalidGeometry", "thumbnail requires non-zero dimensions: %.20gx%.20g",
(double) columns, (double) rows);
return (Image *) NULL;
}
Additionally, consider tightening validation in GetGeometry() so that colon-only (and similar malformed) inputs do not yield WidthValue/HeightValue with zero, or are rejected outright. Variants like "x:" or ":x" may also need explicit handling (maintainer confirmation requested).
Frequently Asked Questions
- What is CVE-2025-55212? CVE-2025-55212 is a low-severity security vulnerability in Magick.NET-Q16-AnyCPU (nuget), affecting versions < 14.8.1. It is fixed in 14.8.1.
- How severe is CVE-2025-55212? CVE-2025-55212 has a CVSS score of 3.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2025-55212?
Magick.NET-Q16-AnyCPU(nuget) (versions < 14.8.1)Magick.NET-Q16-HDRI-AnyCPU(nuget) (versions < 14.8.1)Magick.NET-Q16-HDRI-OpenMP-arm64(nuget) (versions < 14.8.1)Magick.NET-Q16-HDRI-OpenMP-x64(nuget) (versions < 14.8.1)Magick.NET-Q16-HDRI-arm64(nuget) (versions < 14.8.1)Magick.NET-Q16-HDRI-x64(nuget) (versions < 14.8.1)Magick.NET-Q16-HDRI-x86(nuget) (versions < 14.8.1)Magick.NET-Q16-OpenMP-arm64(nuget) (versions < 14.8.1)Magick.NET-Q16-OpenMP-x64(nuget) (versions < 14.8.1)Magick.NET-Q16-arm64(nuget) (versions < 14.8.1)Magick.NET-Q16-x64(nuget) (versions < 14.8.1)Magick.NET-Q16-x86(nuget) (versions < 14.8.1)Magick.NET-Q8-AnyCPU(nuget) (versions < 14.8.1)Magick.NET-Q8-OpenMP-arm64(nuget) (versions < 14.8.1)Magick.NET-Q8-OpenMP-x64(nuget) (versions < 14.8.1)Magick.NET-Q8-arm64(nuget) (versions < 14.8.1)Magick.NET-Q8-x64(nuget) (versions < 14.8.1)Magick.NET-Q8-x86(nuget) (versions < 14.8.1)
- Is there a fix for CVE-2025-55212? Yes. CVE-2025-55212 is fixed in 14.8.1. Upgrade to this version or later.
- Is CVE-2025-55212 exploitable, and should I be worried? Whether CVE-2025-55212 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2025-55212 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2025-55212?
- Upgrade
Magick.NET-Q16-AnyCPUto 14.8.1 or later - Upgrade
Magick.NET-Q16-HDRI-AnyCPUto 14.8.1 or later - Upgrade
Magick.NET-Q16-HDRI-OpenMP-arm64to 14.8.1 or later - Upgrade
Magick.NET-Q16-HDRI-OpenMP-x64to 14.8.1 or later - Upgrade
Magick.NET-Q16-HDRI-arm64to 14.8.1 or later - Upgrade
Magick.NET-Q16-HDRI-x64to 14.8.1 or later - Upgrade
Magick.NET-Q16-HDRI-x86to 14.8.1 or later - Upgrade
Magick.NET-Q16-OpenMP-arm64to 14.8.1 or later - Upgrade
Magick.NET-Q16-OpenMP-x64to 14.8.1 or later - Upgrade
Magick.NET-Q16-arm64to 14.8.1 or later - Upgrade
Magick.NET-Q16-x64to 14.8.1 or later - Upgrade
Magick.NET-Q16-x86to 14.8.1 or later - Upgrade
Magick.NET-Q8-AnyCPUto 14.8.1 or later - Upgrade
Magick.NET-Q8-OpenMP-arm64to 14.8.1 or later - Upgrade
Magick.NET-Q8-OpenMP-x64to 14.8.1 or later - Upgrade
Magick.NET-Q8-arm64to 14.8.1 or later - Upgrade
Magick.NET-Q8-x64to 14.8.1 or later - Upgrade
Magick.NET-Q8-x86to 14.8.1 or later
- Upgrade