ImageMagick
CVE-2025-57807
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload crafted image to processing service
-
DeliveryImageMagick handles memory-backed blob
-
ExploitForward-seek advances offset past end
-
ExecutionWriteBlob under-allocates and copies beyond allocation
-
ImpactHeap corruption enabling potential code execution
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the application to feed attacker-controlled image data through ImageMagick's memory-backed blob path (BlobStream) where a code path invokes SeekBlob() to advance the stream offset forward beyond the current end, followed by WriteBlob() - the under-allocation then writes past the buffer. Target must be a 64-bit (LP64) build; the advisory observed it on macOS arm64 and notes it is architecture-agnostic on LP64. Explicitly NOT required: external delegates, special security policy settings, or 2⁶⁴ integer wraparound. Limiting factors: reachability depends on which coder/operation drives a forward seek before write, and on the integrating application actually passing untrusted images to ImageMagick; no authentication is required per the CVSS vector (PR:N), but a vulnerable processing workflow must be exposed to attacker input. |
| Impact | Signals conflict sharply and must be weighed carefully. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H → 9.8) describes a maximally severe, unauthenticated, low-complexity network flaw, and the technical evidence supports a serious, *deterministic* heap out-of-bounds write (attacker-controlled bytes at an attacker-chosen offset) with potential for code execution. A public writeup/advisory (GHSA-23hg-53q6-hqfg) and vendor patch commit exist, so 'publicly available exploit code exists.' However, the exploitation-probability signals pull the other way: EPSS is only 0.04% (13th percentile) and the CVE is NOT in CISA KEV - there is no evidence of active, widespread exploitation. The low EPSS alongside a public PoC suggests the capability is documented but not yet operationalized at scale, likely because real-world reachability depends on the host application actually driving ImageMagick's BlobStream through a forward-seek-then-write path. Net: this is a genuinely high-severity memory-corruption primitive in a very widely deployed library and should be patched promptly, but the raw 9.8 overstates near-term mass-exploitation likelihood given a 0.04% EPSS and no KEV listing - treat as high-priority patch, not confirmed active-attack emergency. Note a versioning caveat: the 'fixed in 14.8.2' figure comes from the Magick.NET NuGet wrappers, while the core ImageMagick advisory was tested against 7.1.2-0/7.1.2-1 - confirm the exact fixed build for your distribution. |
| Exploit ScenarioDerived | An attacker submits a crafted image file to a service that processes it with a vulnerable ImageMagick build (e.g., an upload/thumbnailing endpoint). During memory-backed blob I/O, a forward SeekBlob() pushes the offset past the end of the buffer and the subsequent WriteBlob() under-allocates, copying attacker bytes beyond the allocation and corrupting the heap. Public advisory and patch-level detail exist (PoC-grade), so a working exploit path is realistic, though no active exploitation is confirmed (not in KEV, EPSS 0.04%). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Oct 19, 2026
Heap-based out-of-bounds write in ImageMagick's memory-backed BlobStream I/O (MagickCore/blob.c) allows remote, unauthenticated attackers who can get image data processed through a vulnerable seek-then-write path to place attacker-controlled bytes at an attacker-chosen offset beyond the end of a heap buffer, with potential for code execution consistent with the CVSS 9.8 vector (C:H/I:H/A:H). Confirmed affected builds include 7.1.2-0 and 7.1.2-1 on LP64 platforms (observed on macOS arm64, architecture-agnostic on 64-bit builds), plus Magick.NET packages below 14.8.2; the issue is fixed in 14.8.2. Publicly available exploit code exists, but EPSS is only 0.04% (13th percentile) and there is no CISA KEV listing, so the very high severity score conflicts with currently low observed exploitation likelihood and real-world risk hinges on whether an application exposes ImageMagick's blob processing to untrusted images.
Earlier versions of this analysis (1)
ImageMagick is free and open-source software used for editing and manipulating digital images. Rated low severity (CVSS 3.8). Public exploit code available.
RemediationAI
Vendor-released patch: 14.8.2. Upgrade ImageMagick to 14.8.2 or later, and update Magick.NET-Q16-x64, Magick.NET-Q8-x64, Magick.NET-Q16-HDRI-x64 and Magick.NET-Q8-OpenMP-x64 to 14.8.2 or later; the fix is in upstream commit 077a417a19a5ea8c85559b602754a5b928eef23e (details at https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-23hg-53q6-hqfg), and Debian LTS users should follow https://lists.debian.org/debian-lts-announce/2025/09/msg00012.html. Until patched, treat the exposure as input-dependent: do not pass untrusted images into ImageMagick workflows that use memory-backed blobs with forward seeks, and isolate image processing in a low-privilege, resource-limited sandbox or container so an out-of-bounds heap write cannot reach sensitive memory. Restricting coder and delegate availability through policy.xml (for example disabling coders not required by the business workflow) reduces the number of paths that can drive a forward seek before a write, but the advisory explicitly states that no special policy settings are needed to trigger the bug, so policy hardening is defense in depth rather than a reliable fix and may break legitimate format support. Additional compensating controls include running the interpreter with hardened allocators/ASLR and memory limits, and monitoring for crashes or anomalous memory behavior in image-processing services, accepting that these measures detect rather than prevent exploitation.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 12 packages in nuget
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is a CWE-122 heap-based buffer overflow in the MagickCore blob I/O subsystem, specifically in the interaction between SeekBlob() and WriteBlob() when a blob is memory-backed (BlobStream). On LP64 builds, blob_info->offset is a signed 64-bit MagickOffsetType while extent, length and quantum are unsigned 64-bit size_t values. SeekBlob() updates the stream offset to arbitrary positions, including past the current end of the allocation, without growing capacity. WriteBlob() then tests offset + length against extent and, when growth is needed, expands the buffer only by length + quantum (amortized) rather than by offset + length, and finally performs memmove(data + (size_t)offset, src, length). When offset is much larger than extent, the destination pointer lands beyond the reallocated buffer and the copy becomes a deterministic heap write of attacker-influenced data at an attacker-chosen offset. No 2^64 integer wraparound, external delegate invocation, or non-default policy setting is required. The upstream fix commit 077a417a19a5ea8c85559b602754a5b928eef23e addresses both the BlobStream and WriteBlob growth logic: WriteBlobStream() now increments extent (extent += quantum + length) instead of recomputing it from the stale extent, and WriteBlob() computes extent = (MagickSizeType)(offset + length) and sets extent = extent + quantum + length before the copy, ensuring capacity always covers the target offset.
Know when Imagemagick gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Crafted image reaches blob I/O remotely without auth or interaction (AV:N/AC:L/PR:N/UI:N); deterministic heap write yields memory corruption and potential code execution (C/I/A:H).
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
6DescriptionNVD
ImageMagick is free and open-source software used for editing and manipulating digital images. ImageMagick versions lower than 14.8.2 include insecure functions: SeekBlob(), which permits advancing the stream offset beyond the current end without increasing capacity, and WriteBlob(), which then expands by quantum + length (amortized) instead of offset + length, and copies to data + offset. When offset ≫ extent, the copy targets memory beyond the allocation, producing a deterministic heap write on 64-bit builds. No 2⁶⁴ arithmetic wrap, external delegates, or policy settings are required. This is fixed in version 14.8.2.
Executive ViewAI
ImageMagick's blob-processing code - a component most organizations never see directly but which sits behind countless image upload, thumbnail, and conversion features - contains a critical memory-corruption flaw that lets an attacker who supplies a crafted image place controlled bytes past the end of a heap buffer, with potential for arbitrary code execution under the service account. Because ImageMagick is typically embedded inside other products and pipelines rather than deployed as a named system, leadership should read this as an attack-surface question: any internet-facing upload, avatar, document-conversion, or media-ingest path that hands untrusted images to an affected build is a candidate entry point. Severity is high but observed exploitation is currently limited, so the priority is inventorying and patching exposed image-processing paths rather than launching a broad incident response.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
Affected Products (CPE)NVD
More in Imagemagick
View allThe (1) EPHEMERAL, (2) HTTPS, (3) MVG, (4) MSL, (5) TEXT, (6) SHOW, (7) WIN, and (8) PLT coders in ImageMagick before 6.
The (1) HTTP and (2) FTP coders in ImageMagick before 6.9.3-10 and 7.x before 7.0.1-1 allow remote attackers to conduct
The EPHEMERAL coder in ImageMagick before 6.9.3-10 and 7.x before 7.0.1-1 allows remote attackers to delete arbitrary fi
ReadGIFImage in coders/gif.c in ImageMagick 7.0.6-1 and GraphicsMagick 1.3.26 leaves the palette uninitialized when proc
Integer overflow in MagickCore/profile.c in ImageMagick before 7.0.2-1 allows remote attackers to cause a denial of serv
The LABEL coder in ImageMagick before 6.9.3-10 and 7.x before 7.0.1-1 allows remote attackers to read arbitrary files vi
The OpenBlob function in blob.c in GraphicsMagick before 1.3.24 and ImageMagick allows remote attackers to execute arbit
The DCM reader in ImageMagick before 6.9.4-5 and 7.x before 7.0.1-7 allows remote attackers to have unspecified impact b
The ReadDCMImage function in DCM reader in ImageMagick before 6.9.4-5 and 7.x before 7.0.1-7 allows remote attackers to
The DCM reader in ImageMagick before 6.9.4-5 and 7.x before 7.0.1-7 allows remote attackers to have unspecified impact b
ImageMagick 7.0.6-5 has a memory leak vulnerability in ReadWEBPImage in coders/webp.c because memory is not freed in cer
Heap buffer overflow in ImageMagick's XBM image decoder (ReadXBMImage) lets remote attackers write attacker-controlled d
NVD
CVE.org
EPSS
GitHub
Exploit-DB