
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-40310 is a heap out-of-bounds write vulnerability in the JP2 (JPEG 2000) encoder of ImageMagick, triggered when a user specifies an invalid sampling index. It affects all ImageMagick versions prior to 6.9.13-44 (6.x branch) and prior to 7.1.2-19 (7.x branch). The vulnerability was disclosed on April 13, 2026, with patches released the same day. It carries a CVSS v3.1 base score of 5.5 (Medium) (GitHub Advisory, Red Hat Bugzilla).
The root cause is improper validation of a user-supplied sampling index in the JP2 encoder (coders/jp2.c), classified as CWE-122 (Heap-based Buffer Overflow), CWE-787 (Out-of-bounds Write), and CWE-1285 (Improper Validation of Specified Index, Position, or Offset in Input). The fix, applied in commit 3d653be, wraps the subsampling_dx and subsampling_dy assignments with MagickMax(..., 1.0) to enforce a minimum valid value, preventing out-of-bounds heap writes when an invalid (e.g., zero or negative) sampling factor is provided (GitHub Commit). Exploitation requires local access and user interaction — specifically, a user must process a maliciously crafted image file with an invalid sampling index through the JP2 encoder (GitHub Advisory).
Successful exploitation results in a denial of service through a crash of the ImageMagick process due to the heap out-of-bounds write. There is no confidentiality or integrity impact — the vulnerability's availability impact is rated High, while confidentiality and integrity impacts are None. The attack scope is unchanged, meaning the impact is confined to the ImageMagick process itself without lateral movement potential (GitHub Advisory, Red Hat Bugzilla).
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation at this time. The EPSS score is approximately 0.012% (0.000120), indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No threat actor attribution has been reported (Feedly, GitHub Advisory).
sampling_factor parameter.convert malicious.jp2 output.png or through an application that uses ImageMagick for image processing).coders/jp2.c, which crashes the ImageMagick process (GitHub Commit, GitHub Advisory).convert, magick, or application processes embedding ImageMagick) when processing JP2/JPEG 2000 files.Update ImageMagick to version 6.9.13-44 or later (6.x branch) or 7.1.2-19 or later (7.x branch). For .NET users, Magick.NET 14.12.0 incorporates the fix. As a workaround, restrict user access to JP2 encoding functionality if not required, and implement input validation to prevent processing of untrusted image files. Distribution-specific packages have been updated for openSUSE, Debian, and Amazon Linux 2/2023 (GitHub Advisory, Magick.NET Release, Red Hat Bugzilla).
The vulnerability was reported by researcher jakelamberson and published by ImageMagick maintainer dlemstra via GitHub Security Advisories on April 13, 2026. Red Hat tracked the issue as medium severity in their Bugzilla system. Downstream Linux distributions including openSUSE, Debian, and Amazon Linux issued security updates shortly after disclosure. No significant broader media coverage or notable community controversy has been observed (GitHub Advisory, Red Hat Bugzilla).
Fix availability across major Linux distributions and their releases.
bookworm
imagemagick: 8:6.9.11.60+dfsg-1.6+deb12u9
sid
imagemagick: 8:7.1.2.19+dfsg1-1
trixie
imagemagick: 8:7.1.1.43+dfsg1-1+deb13u8
bionic (esm-infra)
imagemagick: 8:6.9.7.4+dfsg-16ubuntu6.15+esm17
devel
imagemagick
focal (esm-apps)
imagemagick: 8:6.9.10.23+dfsg-2.1ubuntu11.11+esm15
jammy
imagemagick
jammy (esm-apps)
imagemagick: 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5+esm15
noble
imagemagick
noble (esm-apps)
imagemagick: 8:6.9.12.98+dfsg1-5.2ubuntu0.1~esm14
resolute
imagemagick
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."