CVE-2025-53019

CVE-2025-53019 is a low-severity out-of-bounds read vulnerability in Magick.NET-Q16-AnyCPU (nuget), affecting versions < 14.7.0. It is fixed in 14.7.0.

Summary

In ImageMagick's magick stream command, specifying multiple consecutive %d format specifiers in a filename template causes a memory leak.

Details

  • Vulnerability Type: Memory leak
  • Affected Version: ImageMagick 7.1.1-47 (as of commit 82572afc, June 2025)

Reproduction

Tested Environment

  • Operating System: Ubuntu 22.04 LTS
  • Architecture: x86_64
  • Compiler: gcc with AddressSanitizer (gcc version: 11.4.0)

Reproduction Steps

# Clone source
git clone --depth 1 --branch 7.1.1-47 https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1
cd ImageMagick-7.1.1

# Build with ASan
CFLAGS="-g -O0 -fsanitize=address -fno-omit-frame-pointer" CXXFLAGS="$CFLAGS" LDFLAGS="-fsanitize=address" ./configure --enable-maintainer-mode --enable-shared && make -j$(nproc) && make install

# Trigger crash
./utilities/magick stream %d%d a a

Output

$ magick stream %d%d a a
stream: no decode delegate for this image format `' @ error/constitute.c/ReadImage/746.
stream: missing an image filename `a' @ error/stream.c/StreamImageCommand/755.

=================================================================
==114==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 152 byte(s) in 1 object(s) allocated from:
    #0 0x7fc4ebe58887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x7fc4eb563c5c in AcquireMagickMemory MagickCore/memory.c:559
    #2 0x7fc4eb563c82 in AcquireCriticalMemory MagickCore/memory.c:635
    #3 0x7fc4eb60c2be in AcquireQuantumInfo MagickCore/quantum.c:119
    #4 0x7fc4eb6b6621 in StreamImage MagickCore/stream.c:1335
    #5 0x7fc4eb09d889 in StreamImageCommand MagickWand/stream.c:292
    #6 0x7fc4eaf1295d in MagickCommandGenesis MagickWand/magick-cli.c:177
    #7 0x55a34f7c0a0c in MagickMain utilities/magick.c:153
    #8 0x55a34f7c0cba in main utilities/magick.c:184
    #9 0x7fc4ea38fd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fc4ebe5957c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226
    #1 0x7fc4eb680e2f in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7fc4eb680f30 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7fc4eb60d38d in GetQuantumInfo MagickCore/quantum.c:435
    #4 0x7fc4eb60c30e in AcquireQuantumInfo MagickCore/quantum.c:121
    #5 0x7fc4eb6b6621 in StreamImage MagickCore/stream.c:1335
    #6 0x7fc4eb09d889 in StreamImageCommand MagickWand/stream.c:292
    #7 0x7fc4eaf1295d in MagickCommandGenesis MagickWand/magick-cli.c:177
    #8 0x55a34f7c0a0c in MagickMain utilities/magick.c:153
    #9 0x55a34f7c0cba in main utilities/magick.c:184
    #10 0x7fc4ea38fd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

SUMMARY: AddressSanitizer: 216 byte(s) leaked in 2 allocation(s).

Commits

Fixed in https://github.com/ImageMagick/ImageMagick/commit/fc3ab0812edef903bbb2473c0ee652ddfd04fe5c and https://github.com/ImageMagick/ImageMagick6/commit/d49460522669232159c2269fa64f73ed30555c1b

Impact

A read operation accesses a memory location beyond the intended buffer boundary. Typical impact: sensitive data disclosure or crash.

CVE-2025-53019 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.7.0); upgrading removes the vulnerable code path.

Affected versions

Magick.NET-Q16-AnyCPU (< 14.7.0) Magick.NET-Q16-HDRI-AnyCPU (< 14.7.0) Magick.NET-Q16-HDRI-OpenMP-arm64 (< 14.7.0) Magick.NET-Q16-HDRI-OpenMP-x64 (< 14.7.0) Magick.NET-Q16-HDRI-arm64 (< 14.7.0) Magick.NET-Q16-HDRI-x64 (< 14.7.0) Magick.NET-Q16-HDRI-x86 (< 14.7.0) Magick.NET-Q16-OpenMP-arm64 (< 14.7.0) Magick.NET-Q16-OpenMP-x64 (< 14.7.0) Magick.NET-Q16-arm64 (< 14.7.0) Magick.NET-Q16-x64 (< 14.7.0) Magick.NET-Q16-x86 (< 14.7.0) Magick.NET-Q8-AnyCPU (< 14.7.0) Magick.NET-Q8-OpenMP-arm64 (< 14.7.0) Magick.NET-Q8-OpenMP-x64 (< 14.7.0) Magick.NET-Q8-arm64 (< 14.7.0) Magick.NET-Q8-x64 (< 14.7.0) Magick.NET-Q8-x86 (< 14.7.0)

Security releases

Magick.NET-Q16-AnyCPU → 14.7.0 (nuget) Magick.NET-Q16-HDRI-AnyCPU → 14.7.0 (nuget) Magick.NET-Q16-HDRI-OpenMP-arm64 → 14.7.0 (nuget) Magick.NET-Q16-HDRI-OpenMP-x64 → 14.7.0 (nuget) Magick.NET-Q16-HDRI-arm64 → 14.7.0 (nuget) Magick.NET-Q16-HDRI-x64 → 14.7.0 (nuget) Magick.NET-Q16-HDRI-x86 → 14.7.0 (nuget) Magick.NET-Q16-OpenMP-arm64 → 14.7.0 (nuget) Magick.NET-Q16-OpenMP-x64 → 14.7.0 (nuget) Magick.NET-Q16-arm64 → 14.7.0 (nuget) Magick.NET-Q16-x64 → 14.7.0 (nuget) Magick.NET-Q16-x86 → 14.7.0 (nuget) Magick.NET-Q8-AnyCPU → 14.7.0 (nuget) Magick.NET-Q8-OpenMP-arm64 → 14.7.0 (nuget) Magick.NET-Q8-OpenMP-x64 → 14.7.0 (nuget) Magick.NET-Q8-arm64 → 14.7.0 (nuget) Magick.NET-Q8-x64 → 14.7.0 (nuget) Magick.NET-Q8-x86 → 14.7.0 (nuget)

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.

See it in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

Magick.NET-Q16-AnyCPU to 14.7.0 or later; Magick.NET-Q16-HDRI-AnyCPU to 14.7.0 or later; Magick.NET-Q16-HDRI-OpenMP-arm64 to 14.7.0 or later; Magick.NET-Q16-HDRI-OpenMP-x64 to 14.7.0 or later; Magick.NET-Q16-HDRI-arm64 to 14.7.0 or later; Magick.NET-Q16-HDRI-x64 to 14.7.0 or later; Magick.NET-Q16-HDRI-x86 to 14.7.0 or later; Magick.NET-Q16-OpenMP-arm64 to 14.7.0 or later; Magick.NET-Q16-OpenMP-x64 to 14.7.0 or later; Magick.NET-Q16-arm64 to 14.7.0 or later; Magick.NET-Q16-x64 to 14.7.0 or later; Magick.NET-Q16-x86 to 14.7.0 or later; Magick.NET-Q8-AnyCPU to 14.7.0 or later; Magick.NET-Q8-OpenMP-arm64 to 14.7.0 or later; Magick.NET-Q8-OpenMP-x64 to 14.7.0 or later; Magick.NET-Q8-arm64 to 14.7.0 or later; Magick.NET-Q8-x64 to 14.7.0 or later; Magick.NET-Q8-x86 to 14.7.0 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2025-53019? CVE-2025-53019 is a low-severity out-of-bounds read vulnerability in Magick.NET-Q16-AnyCPU (nuget), affecting versions < 14.7.0. It is fixed in 14.7.0. A read operation accesses a memory location beyond the intended buffer boundary.
  2. How severe is CVE-2025-53019? CVE-2025-53019 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.
  3. Which packages are affected by CVE-2025-53019?
    • Magick.NET-Q16-AnyCPU (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-HDRI-AnyCPU (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-HDRI-OpenMP-arm64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-HDRI-OpenMP-x64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-HDRI-arm64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-HDRI-x64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-HDRI-x86 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-OpenMP-arm64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-OpenMP-x64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-arm64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-x64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q16-x86 (nuget) (versions < 14.7.0)
    • Magick.NET-Q8-AnyCPU (nuget) (versions < 14.7.0)
    • Magick.NET-Q8-OpenMP-arm64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q8-OpenMP-x64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q8-arm64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q8-x64 (nuget) (versions < 14.7.0)
    • Magick.NET-Q8-x86 (nuget) (versions < 14.7.0)
  4. Is there a fix for CVE-2025-53019? Yes. CVE-2025-53019 is fixed in 14.7.0. Upgrade to this version or later.
  5. Is CVE-2025-53019 exploitable, and should I be worried? Whether CVE-2025-53019 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
  6. What actually determines whether CVE-2025-53019 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.
  7. How do I fix CVE-2025-53019?
    • Upgrade Magick.NET-Q16-AnyCPU to 14.7.0 or later
    • Upgrade Magick.NET-Q16-HDRI-AnyCPU to 14.7.0 or later
    • Upgrade Magick.NET-Q16-HDRI-OpenMP-arm64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-HDRI-OpenMP-x64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-HDRI-arm64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-HDRI-x64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-HDRI-x86 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-OpenMP-arm64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-OpenMP-x64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-arm64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-x64 to 14.7.0 or later
    • Upgrade Magick.NET-Q16-x86 to 14.7.0 or later
    • Upgrade Magick.NET-Q8-AnyCPU to 14.7.0 or later
    • Upgrade Magick.NET-Q8-OpenMP-arm64 to 14.7.0 or later
    • Upgrade Magick.NET-Q8-OpenMP-x64 to 14.7.0 or later
    • Upgrade Magick.NET-Q8-arm64 to 14.7.0 or later
    • Upgrade Magick.NET-Q8-x64 to 14.7.0 or later
    • Upgrade Magick.NET-Q8-x86 to 14.7.0 or later

Other vulnerabilities in Magick.NET-Q16-AnyCPU

CVE-2026-53465CVE-2026-53464CVE-2026-53463CVE-2026-53462CVE-2026-53461

Stop the waste.
Protect your environment with Kodem.