Skip to main content

ImageMagick CVE-2025-57807

CRITICAL
Heap-based Buffer Overflow (CWE-122)
2025-09-05 security-advisories@github.com
9.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload crafted image to processing service
  2. Delivery
    ImageMagick handles memory-backed blob
  3. Exploit
    Forward-seek advances offset past end
  4. Execution
    WriteBlob under-allocates and copies beyond allocation
  5. Impact
    Heap 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%).

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 Mar 28, 2026 - 19:10 CVSS 3.8

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

nuget magick.net-q16-arm64 fix: 14.8.2
nuget magick.net-q16-hdri-arm64 fix: 14.8.2
nuget magick.net-q16-hdri-openmp-arm64 fix: 14.8.2
nuget magick.net-q16-hdri-openmp-x64 fix: 14.8.2
nuget magick.net-q16-hdri-x64 fix: 14.8.2
nuget magick.net-q16-openmp-arm64 fix: 14.8.2
nuget magick.net-q16-openmp-x64 fix: 14.8.2
nuget magick.net-q16-x64 fix: 14.8.2
nuget magick.net-q8-arm64 fix: 14.8.2
nuget magick.net-q8-openmp-arm64 fix: 14.8.2
nuget magick.net-q8-openmp-x64 fix: 14.8.2
nuget magick.net-q8-x64 fix: 14.8.2

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

NVD PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.8 CRITICAL

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).

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

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

Lifecycle Timeline

6
Analysis Updated
Oct 19, 2026 - 17:30 vuln.today
v2 - CVSS changed
Severity Changed
Oct 19, 2026 - 17:23 NVD
LOW CRITICAL
CVSS changed
Oct 19, 2026 - 17:23 NVD
3.8 (LOW) 9.8 (CRITICAL)
Patch released
Mar 28, 2026 - 19:10 nvd
Patch available
PoC Detected
Nov 03, 2025 - 19:16 vuln.today
Public exploit code
CVE Published
Sep 05, 2025 - 22:15 nvd
LOW 3.8

DescriptionNVD

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Prevalence
High
ImageMagick is a ubiquitous image-processing library across web servers and apps
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

69
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*
cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*
CVE-2016-3714 HIGH POC
8.4 May 05

The (1) EPHEMERAL, (2) HTTPS, (3) MVG, (4) MSL, (5) TEXT, (6) SHOW, (7) WIN, and (8) PLT coders in ImageMagick before 6.

CVE-2016-3718 MEDIUM POC
5.5 May 05

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

CVE-2016-3715 MEDIUM POC
5.5 May 05

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

CVE-2017-15277 MEDIUM POC
6.5 Oct 12

ReadGIFImage in coders/gif.c in ImageMagick 7.0.6-1 and GraphicsMagick 1.3.26 leaves the palette uninitialized when proc

CVE-2016-5841 CRITICAL POC
9.8 Dec 13

Integer overflow in MagickCore/profile.c in ImageMagick before 7.0.2-1 allows remote attackers to cause a denial of serv

CVE-2016-3717 MEDIUM POC
5.5 May 05

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

CVE-2016-5118 CRITICAL
9.8 Jun 10

The OpenBlob function in blob.c in GraphicsMagick before 1.3.24 and ImageMagick allows remote attackers to execute arbit

CVE-2016-5689 CRITICAL POC
9.8 Dec 13

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

CVE-2016-5690 CRITICAL POC
9.8 Dec 13

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

CVE-2016-5691 CRITICAL POC
9.8 Dec 13

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

CVE-2017-14138 CRITICAL POC
9.8 Sep 04

ImageMagick 7.0.6-5 has a memory leak vulnerability in ReadWEBPImage in coders/webp.c because memory is not freed in cer

CVE-2026-23876 CRITICAL POC
9.8 Jan 20

Heap buffer overflow in ImageMagick's XBM image decoder (ReadXBMImage) lets remote attackers write attacker-controlled d

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy