Skip to main content

ImageMagick CVE-2026-40310

| EUVDEUVD-2026-22116 MEDIUM
Heap-based Buffer Overflow (CWE-122)
2026-04-13 GitHub_M GHSA-pwg5-6jfc-crvh
5.5
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Access
    Control JP2 encoding input parameters
  2. Delivery
    Supply zero or negative sampling index value
  3. Exploit
    ImageMagick WriteJP2Image casts value without clamping
  4. Execution
    Heap out-of-bounds write in coders/jp2.c
  5. Impact
    Process crash (denial of service)

Vulnerability Assessment

Weakness
CWE
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 local execution of ImageMagick with user interaction: a user or automated process must explicitly invoke the JP2 encoder and supply an invalid subsampling index (a value that resolves to zero or a negative number for subsampling_dx or subsampling_dy). The vulnerability is confined to the JP2 encoder code path in coders/jp2.c - general image parsing or other format encoders are not affected. CVSS PR:N indicates no OS-level privilege elevation is needed for a local user to trigger the flaw. UI:R indicates a user must actively initiate the encoding operation rather than the attack being passively triggered. Exploitation is limited by: (1) the AV:L constraint - direct remote exploitation is not possible; (2) the trigger being confined to JP2 encoding with attacker-controlled subsampling parameters; (3) SSVC non-automatable classification, meaning mass exploitation is not feasible; and (4) absence of any public exploit code. Indirect remote triggering is plausible only where a service wraps ImageMagick JP2 encoding and exposes user-controlled encoding parameters without input validation.

Impact

The CVSS 5.5 score with vector AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H accurately reflects the constrained threat model: local access is required, a user must actively initiate the JP2 encoding operation, and the only confirmed impact is availability (process crash). EPSS at 0.01% (2nd percentile) is consistent with the lack of any remote or unauthenticated exploitation path. SSVC reinforces this: exploitation status is none, the attack is non-automatable, and technical impact is partial. There is no CISA KEV listing and no public exploit code referenced in available data. The primary realistic risk exists in image processing pipelines or web services that accept user-controlled JP2 encoding parameters and invoke ImageMagick locally - these could be crashed remotely by an end-user triggering the vulnerable code path indirectly, effectively elevating the practical attack vector. Red Hat and SUSE have tagged this vulnerability, indicating downstream distribution advisories are likely. Despite being a heap write primitive (which in theory could be developed into code execution), the narrow trigger condition and absence of any exploit code makes code execution a theoretical rather than practical concern at time of analysis.

Exploit ScenarioDerived

A local user or an application processing external content invokes ImageMagick to encode an image to JP2 format and passes a crafted subsampling parameter resolving to zero or a negative value - for example via the -define jp2:rate or sampling-factor option. The JP2 encoder in coders/jp2.c casts the invalid value to int and writes out of bounds on the heap, crashing the ImageMagick process. In a web service that wraps ImageMagick for user-uploaded image conversion, an attacker could craft the upload to indirectly trigger this path, causing a denial of service for the encoding worker process. No public exploit code is available at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 24, 2026

Heap out-of-bounds write in ImageMagick's JP2 (JPEG 2000) encoder affects all versions of the 7.x branch below 7.1.2-19 and the 6.x branch below 6.9.13-44, as well as the Magick.NET .NET bindings below 14.12.0. When a user specifies an invalid (zero or negative) subsampling index during JP2 encoding, the subsampling_dx and subsampling_dy parameters are cast to int without clamping, enabling a write beyond the allocated heap buffer. The attack vector is local with required user interaction (AV:L/UI:R), EPSS is 0.01% (2nd percentile), SSVC classifies exploitation as none and non-automatable, and no public exploit or KEV listing exists - placing this firmly in the low-urgency remediation tier for most environments.

RemediationAI

Upgrade ImageMagick to version 7.1.2-19 or later (https://github.com/ImageMagick/ImageMagick/releases/tag/7.1.2-19) for 7.x deployments, or to 6.9.13-44 for legacy 6.x deployments. For .NET applications using Magick.NET, upgrade to version 14.12.0 or later (https://github.com/dlemstra/Magick.NET/releases/tag/14.12.0). The source-level fix is available in commit 3d653bea2df085c728a1c8f775808e1e9249dff9. Where immediate patching is not feasible, disable JP2/JPEG 2000 encoder support in ImageMagick policy.xml (set rights="none" for the JP2 format) to eliminate the vulnerable code path - the trade-off is loss of JPEG 2000 write capability. For image processing services that accept user-supplied encoding parameters, sanitize or reject subsampling index values below 1 at the application layer as an interim control.

Affected VersionsENISA

ImageMagick < 6.9.13-44
ImageMagick < 7.1.2-19

Affected Packages

nuget magick.net-q16-anycpu fix: 14.12.0
nuget magick.net-q16-arm64 fix: 14.12.0
nuget magick.net-q16-hdri-anycpu fix: 14.12.0
nuget magick.net-q16-hdri-openmp-arm64 fix: 14.12.0
nuget magick.net-q16-hdri-x64 fix: 14.12.0
nuget magick.net-q16-hdri-x86 fix: 14.12.0
nuget magick.net-q16-openmp-arm64 fix: 14.12.0
nuget magick.net-q16-openmp-x64 fix: 14.12.0
nuget magick.net-q16-x64 fix: 14.12.0
nuget magick.net-q16-x86 fix: 14.12.0
nuget magick.net-q8-anycpu fix: 14.12.0
nuget magick.net-q8-arm64 fix: 14.12.0
nuget magick.net-q8-openmp-arm64 fix: 14.12.0
nuget magick.net-q8-openmp-x64 fix: 14.12.0
nuget magick.net-q8-x64 fix: 14.12.0
nuget magick.net-q8-x86 fix: 14.12.0
euvd imagemagick fix: 6.9.13-44, 7.1.2-19

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 17 packages in nuget, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

ImageMagick is a free, open-source image manipulation library and CLI suite supporting dozens of image formats. The vulnerability resides in coders/jp2.c within the WriteJP2Image function, where user-controlled subsampling parameters (geometry_info.rho and geometry_info.sigma) were cast directly to int without bounds enforcement: parameters->subsampling_dx=(int) geometry_info.rho. An invalid value (e.g., zero or negative) produces an out-of-bounds write on the heap when the JP2 encoder subsequently uses that index. The fix (commit 3d653bea2df085c728a1c8f775808e1e9249dff9) wraps both assignments with MagickMax(..., 1.0) to enforce a minimum valid subsampling factor of 1. CWE-122 (Heap-based Buffer Overflow) describes this root-cause class. The Magick.NET .NET binding packages (Q16-AnyCPU, Q16-HDRI-AnyCPU, Q16-HDRI-OpenMP-arm64, Q16-HDRI-x64) wrap the native ImageMagick library and inherit this flaw. CPE cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:* covers the full affected range.

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

GitHub Advisory PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
vuln.today AI 5.5 MEDIUM

Local vector because trigger requires invoking the JP2 encoder locally; UI:R because a user must initiate encoding; only availability impacted via process crash.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 6.5 MEDIUM

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

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

Lifecycle Timeline

2
Patch released
Apr 14, 2026 - 20:30 nvd
Patch available
CVE Published
Apr 13, 2026 - 21:32 nvd
MEDIUM 5.5

DescriptionGitHub Advisory

ImageMagick is free and open-source software used for editing and manipulating digital images. Versions below both 7.1.2-19 and 6.9.13-44, contain a heap out-of-bounds write in the JP2 encoder with when a user specifies an invalid sampling index. This issue has been fixed in versions 6.9.13-44 and 7.1.2-19.

Threat Intelligence Overview

EPSS Score
0.0%
Top 98% exploitable
Prevalence
High
widely used open-source image processing library across Linux, web stacks, and CI/CD pipelines
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
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.

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-2026-122006 CRITICAL POC
9.8 Nov 04

Unauthenticated attackers can write arbitrary files on a Ruby on Rails host and, when Active Storage uses the Disk servi

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

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Desktop Applications 15 SP7 Fixed
SUSE Linux Enterprise Module for Development Tools 15 SP7 Fixed
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed

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