Skip to main content

CVE-2025-55160 — Vulnerability in Magick.NET-Q8-arm64 — CVE Details

MEDIUM

ImageMagick has Undefined Behavior (function-type-mismatch) in CloneSplayTree

Published August 25, 2025Updated August 25, 2025Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.47%). Schedule for your next planned update.

Does your project use an affected Magick.NET-Q8-arm64 version?

Paste your packages.lock.json to check it for CVE-2025-55160 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my packages.lock.json

Summary

Summary

  • Target: ImageMagick (commit ecc9a5eb456747374bae8e07038ba10b3d8821b3)
  • Type: Undefined Behavior (function-type-mismatch) in splay tree cloning callback
  • Impact: Deterministic abort under UBSan (DoS in sanitizer builds). No crash in a non-sanitized build; likely low security impact.
  • Trigger: Minimal 2-byte input parsed via MagickWand, then coalescing.

Environment

OS: macOS (Apple Silicon/arm64) Homebrew clang version 20.1.8 Target: arm64-apple-darwin24.5.0 Thread model: posix InstalledDir: /opt/homebrew/Cellar/llvm/20.1.8/bin Configuration file: /opt/homebrew/etc/clang/arm64-apple-darwin24.cfg Homebrew ImageMagick: magick -version → ImageMagick 7.1.2-0 Q16-HDRI aarch64 pkg-config: MagickWand-7.Q16HDRI version 7.1.2 Library configure flags (capsule build): ./configure --disable-shared --enable-static --without-modules --without-magick-plus-plus --disable-openmp --without-perl --without-x --with-png=yes --without-jpeg --without-tiff --without-xml --without-lqr --without-gslib Harness compile flags: -fsanitize=fuzzer,address,undefined -fno-omit-frame-pointer pkg-config cflags/libs supplied: -I<...>/include/ImageMagick-7 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 and linked against MagickWand-7.Q16HDRI and MagickCore-7.Q16HDRI Sanitizer runtime: ASan+UBSan defaults. Repro also with UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1

PoC

  • Bytes (hex): 1c 02
  • Base64: HAI=
  • sha256 (optional):

Reproduction

Create PoC:

printf '\x1c\x02' > poc.bin

Option A: libFuzzer harness

  • Run once: ./harness_ImageMagick_... -runs=1 ./poc.bin
  • Expected: UBSan aborts with function-type-mismatch at MagickCore/splay-tree.c:372:43.

Option B: standalone reproducer (C)

  • Compile (ensure PKG_CONFIG_PATH points to your ImageMagick if needed):

/opt/homebrew/opt/llvm/bin/clang -g -O1 -fsanitize=address,undefined $(/opt/homebrew/bin/pkg-config --cflags MagickWand-7.Q16HDRI) repro.c -o repro $(/opt/homebrew/bin/pkg-config --libs MagickWand-7.Q16HDRI)

  • Run:

UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./repro ./poc.bin Observed output (excerpt) MagickCore/splay-tree.c:372:43: runtime error: call to function ConstantString through pointer to incorrect function type 'void ()(void *)' string.c:680: note: ConstantString defined here #0 CloneSplayTree splay-tree.c:372 #1 CloneImageProfiles profile.c:159 #2 CloneImage image.c:832 #3 CoalesceImages layer.c:269 #4 MagickCoalesceImages magick-image.c:1665 #5 main repro.c:XX Root cause The splay tree clone callback expects a function pointer of type void *(*)(void *). ConstantString has a different signature (char *ConstantString(const char *)). Calling through the mismatched function type is undefined behavior in C and triggers UBSan’s function-type-mismatch. The path is exercised during coalescing: CloneImage → CloneImageProfiles → CloneSplayTree. Scope Reproduces with a minimal, sanitizer-instrumented, PNG-enabled build and delegates disabled (policy.xml), suggesting the issue is in MagickCore rather than external delegates. Suggested fix (sketch) Use a wrapper that matches the expected callback prototype, or adjust the splay-tree callback typedef for const-correctness. For example: static void *CloneStringShim(const void *p) { return (void *) ConstantString((const char *) p); }

/* When setting splay-tree clone_value, use CloneStringShim instead of ConstantString. */

Alternatively, update the clone callback typedefs to use const void* consistently (and return void*) and ensure callers pass a correctly typed wrapper.

Artifacts Minimised PoC: attached (poc.bin, 2 bytes; base64 HAI=) Harness source and exact build command (attached) Full UBSan trace (attached) Commit SHA and configure flags (above) Credits Discovered by: Lumina Mescuwa Method: libFuzzer + UBSan Verification

  • UBSan build: Reproduces with halt_on_error=1; aborts at MagickCore/splay-tree.c:372.
  • Non-sanitized Homebrew build (macOS arm64, clang 20.1.8): No crash; repro completes silently.

Advisory Timeline

  • First published August 25, 2025 (458 days ago).
  • Last revised August 25, 2025 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update Magick.NET-Q8-arm64 to 14.8.0 or later
dotnet add package Magick.NET-Q8-arm64 --version 14.8.0
NuGet
Update Magick.NET-Q16-x86 to 14.8.0 or later
dotnet add package Magick.NET-Q16-x86 --version 14.8.0
NuGet
Update Magick.NET-Q16-OpenMP-x64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-OpenMP-x64 --version 14.8.0
NuGet
Update Magick.NET-Q16-HDRI-x64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-HDRI-x64 --version 14.8.0
NuGet
Update Magick.NET-Q8-OpenMP-x64 to 14.8.0 or later
dotnet add package Magick.NET-Q8-OpenMP-x64 --version 14.8.0
NuGet
Update Magick.NET-Q16-HDRI-x86 to 14.8.0 or later
dotnet add package Magick.NET-Q16-HDRI-x86 --version 14.8.0
NuGet
Update Magick.NET-Q8-AnyCPU to 14.8.0 or later
dotnet add package Magick.NET-Q8-AnyCPU --version 14.8.0
NuGet
Update Magick.NET-Q8-x86 to 14.8.0 or later
dotnet add package Magick.NET-Q8-x86 --version 14.8.0
NuGet
Update Magick.NET-Q16-HDRI-AnyCPU to 14.8.0 or later
dotnet add package Magick.NET-Q16-HDRI-AnyCPU --version 14.8.0
NuGet
Update Magick.NET-Q16-OpenMP-arm64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-OpenMP-arm64 --version 14.8.0
NuGet
Update Magick.NET-Q16-HDRI-OpenMP-x64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-HDRI-OpenMP-x64 --version 14.8.0
NuGet
Update Magick.NET-Q16-AnyCPU to 14.8.0 or later
dotnet add package Magick.NET-Q16-AnyCPU --version 14.8.0
NuGet
Update Magick.NET-Q16-HDRI-OpenMP-arm64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-HDRI-OpenMP-arm64 --version 14.8.0
NuGet
Update Magick.NET-Q8-OpenMP-arm64 to 14.8.0 or later
dotnet add package Magick.NET-Q8-OpenMP-arm64 --version 14.8.0
NuGet
Update Magick.NET-Q16-arm64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-arm64 --version 14.8.0
NuGet
Update Magick.NET-Q8-x64 to 14.8.0 or later
dotnet add package Magick.NET-Q8-x64 --version 14.8.0
NuGet
Update Magick.NET-Q16-HDRI-arm64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-HDRI-arm64 --version 14.8.0
NuGet
Update Magick.NET-Q16-x64 to 14.8.0 or later
dotnet add package Magick.NET-Q16-x64 --version 14.8.0

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (18)

Affects 1 ecosystem: NuGet (18).

PackageFixed In
Magick.NET-Q8-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+42 more)14.8.0
Magick.NET-Q16-x86 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+213 more)14.8.0
Magick.NET-Q16-OpenMP-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+94 more)14.8.0
Magick.NET-Q16-HDRI-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+194 more)14.8.0
Magick.NET-Q8-OpenMP-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+94 more)14.8.0
Magick.NET-Q16-HDRI-x86 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+194 more)14.8.0
Magick.NET-Q8-AnyCPU NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+197 more)14.8.0
Magick.NET-Q8-x86 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+213 more)14.8.0
Magick.NET-Q16-HDRI-AnyCPU NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+194 more)14.8.0
Magick.NET-Q16-OpenMP-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+42 more)14.8.0
Magick.NET-Q16-HDRI-OpenMP-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+94 more)14.8.0
Magick.NET-Q16-AnyCPU NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+197 more)14.8.0
Magick.NET-Q16-HDRI-OpenMP-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+42 more)14.8.0
Magick.NET-Q8-OpenMP-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+42 more)14.8.0
Magick.NET-Q16-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+42 more)14.8.0
Magick.NET-Q8-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+213 more)14.8.0
Magick.NET-Q16-HDRI-arm64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+42 more)14.8.0
Magick.NET-Q16-x64 NuGet · Affected: 10.0.0, 10.1.0, 11.0.0, 11.1.0 (+213 more)14.8.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L

Frequently Asked Questions

What is CVE-2025-55160?
ImageMagick has Undefined Behavior (function-type-mismatch) in CloneSplayTree. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
How do I check if my project is affected by CVE-2025-55160?
CVE-2025-55160 affects Magick.NET-Q8-arm64, Magick.NET-Q16-x86 and Magick.NET-Q16-OpenMP-x64 (and 15 more). It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-55160 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.1

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.47%
EPSS percentile: 32.6

This is a below-median EPSS score — only 32.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-6hgw-6x87-578x

Related CVEs

  • CVE-2026-49218
    HIGH

    ImageMagick: Policy Bypass in DCM decoder could result in image with invalid dimensions

  • CVE-2026-25794
    HIGH

    ImageMagick has heap-buffer-overflow via signed integer overflow in WriteUHDRImage when writing UHDR images with large dimensions

  • CVE-2026-28686
    MEDIUM

    ImageMagick: Write heap-buffer-overflow in PCL encoder via undersized output buffer

  • CVE-2026-28689
    MEDIUM

    ImageMagick has a Path Policy TOCTOU symlink race bypass

  • CVE-2026-25638
    MEDIUM

    ImageMagick has memory leak in msl encoder

  • CVE-2026-45624
    MEDIUM

    ImageMagick: Heap Buffer Over-Read of a 4 bytes in distort operation.

  • CVE-2026-56372
    LOW

    ImageMagick has a heap buffer overflow read in magnify operation via unrecognized magnify:method value

  • CVE-2026-61859
    LOW

    ImageMagick: Policy Bypass in script operation due to missing checks

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my packages.lock.json