CVE-2026-40310
Received Received - Intake

Heap Out-of-Bounds Write in ImageMagick JP2 Encoder

Vulnerability report for CVE-2026-40310, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-04-13

Last updated on: 2026-04-17

Assigner: GitHub, Inc.

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-04-13
Last Modified
2026-04-17
Generated
2026-07-06
AI Q&A
2026-04-14
EPSS Evaluated
2026-07-05
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
imagemagick imagemagick to 6.9.13-44 (exc)
imagemagick imagemagick From 7.0.0-0 (inc) to 7.1.2-19 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-122 A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability exists in ImageMagick versions below 7.1.2-19 and 6.9.13-44. It is a heap out-of-bounds write issue in the JP2 encoder that occurs when a user specifies an invalid sampling index.

Impact Analysis

The vulnerability can lead to a heap out-of-bounds write, which may cause a denial of service or potentially allow an attacker to execute arbitrary code. The CVSS score indicates a low attack vector (local), low attack complexity, no privileges required, user interaction required, unchanged scope, no confidentiality or integrity impact, but high availability impact.

Mitigation Strategies

To mitigate this vulnerability, you should upgrade ImageMagick to version 7.1.2-19 or later, or version 6.9.13-44 or later, as these versions contain the fix for the heap out-of-bounds write issue in the JP2 encoder.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-40310. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart