Skip to main content

ImageMagick CVE-2026-40169

| EUVDEUVD-2026-22113 MEDIUM
Heap-based Buffer Overflow (CWE-122)
2026-04-13 GitHub_M GHSA-5592-p365-24xh
6.2
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted image with malicious directory data
  2. Delivery
    Invoke ImageMagick with YAML or JSON output format
  3. Exploit
    EncodeImageAttributes traverses unbounded directory string
  4. Execution
    Out-of-bounds heap write occurs
  5. Impact
    Process crashes (DoS)

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 two specific conditions to be met simultaneously: first, the attacker must be able to supply or influence a crafted image file processed by ImageMagick; second, the ImageMagick invocation must produce YAML or JSON formatted output (e.g., using 'convert input.png output.yaml' or 'convert input.png output.json', or programmatically via Magick.NET with a YAML/JSON output path). The overflow only occurs inside the EncodeImageAttributes function of the YAML and JSON coders - no other output format triggers the vulnerable code path. What limits exploitation: the CVSS vector is AV:L, meaning direct local access or integration via a web application that both accepts untrusted image uploads and writes YAML/JSON output is required; the impact is strictly availability (crash/DoS) with no code execution or data exfiltration observed; and SSVC rates Automatable as 'no', reflecting that chaining the file-supply and format-trigger steps is not trivially automated at scale.

Impact

The provided CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) scores 6.2, reflecting local-vector, low-complexity, no-privileges, availability-only impact. EPSS at 0.01% (2nd percentile) aligns with SSVC's 'Exploitation: none' classification, confirming no observed in-the-wild activity despite a public POC gist being available. SSVC also rates Automatable as 'no', consistent with AV:L requiring physical or logical access to supply the crafted file. Technical Impact is rated 'partial' - the worst realistic outcome is a process crash (DoS), with no confidentiality or integrity impact according to the CVSS vector. The combination of low EPSS, SSVC 'none' exploitation, and availability-only impact places this firmly as a low operational priority for most organizations, though any pipeline that ingests untrusted images and writes YAML/JSON output should patch promptly. One signal worth noting: the public POC exists, so the barrier to reproduction is low, but automatable mass exploitation remains constrained by the local attack vector.

Exploit ScenarioDerived

An attacker submits a specially crafted image file - for example via a web application that accepts user-uploaded images and internally converts them to YAML or JSON metadata output using ImageMagick - causing the EncodeImageAttributes function to perform an out-of-bounds heap write during directory string traversal and crash the ImageMagick worker process. A public proof-of-concept exploit is available at https://gist.github.com/alon710/1dd7eb9b2d2403233c4fe934b5852750, lowering the barrier for reproducing the crash. Repeated exploitation of this path in a server-side image processing pipeline could cause sustained availability disruption.

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-based buffer overflow in ImageMagick's YAML and JSON encoders allows a local attacker to crash the process by supplying a crafted image file converted to YAML or JSON output format. All ImageMagick versions below 7.1.2-19 are affected, including multiple Magick.NET NuGet packages below 14.12.0. A public proof-of-concept exploit exists, but EPSS remains at 0.01% (2nd percentile) and SSVC classifies exploitation as 'none', indicating no observed active exploitation at time of analysis.

RemediationAI

Upgrade ImageMagick to version 7.1.2-19 or later, available at https://github.com/ImageMagick/ImageMagick/releases/tag/7.1.2-19, which contains the patched coders/json.c and coders/yaml.c. For .NET consumers, upgrade all Magick.NET NuGet packages (Magick.NET-Q16-AnyCPU, Magick.NET-Q16-HDRI-AnyCPU, Magick.NET-Q16-HDRI-OpenMP-arm64, Magick.NET-Q16-HDRI-arm64) to version 14.12.0 or later, available at https://github.com/dlemstra/Magick.NET/releases/tag/14.12.0. If immediate patching is not feasible, a targeted workaround is to disable or prohibit YAML and JSON output formats in ImageMagick policy.xml by adding deny rules for the YAML and JSON delegates - this prevents the vulnerable encoder code path from executing entirely, though it will break any workflow that relies on those output formats. Red Hat and SUSE advisories should be monitored for distribution-packaged updates.

Affected VersionsENISA

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-arm64 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: 7.1.2-19

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 18 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

The root cause is CWE-122 (Heap-based Buffer Overflow) located in the EncodeImageAttributes function within coders/json.c and coders/yaml.c. When iterating over entries in image->directory to produce JSON or YAML output, the inner pointer loop increments q through the directory string without bounding q relative to sizeof(image_info->filename). This allows an attacker-controlled crafted image whose directory data exceeds that buffer boundary to cause a single out-of-bounds heap write, ultimately crashing the process. The fix (commit f86452a8aea37bf2b4bd36127f836dcc5f138b38) adds the guard ((size_t)(q-p) < sizeof(image_info->filename)) to the inner while loop and corrects pointer advancement logic in both encoders. The affected CPE is cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:* for ImageMagick core and the nuget/Magick.NET family of .NET wrappers.

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 6.2 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 6.2 MEDIUM

Local file supply triggers the overflow; no privileges or interaction needed; impact is crash only, no confidentiality or integrity consequence.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/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
None
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:25 nvd
MEDIUM 6.2

DescriptionGitHub Advisory

ImageMagick is free and open-source software used for editing and manipulating digital images. In versions below 7.1.2-19, a crafted image could result in an out of bounds heap write when writing a yaml or json output, resulting in a crash. This issue has been fixed in version 7.1.2-19.

Threat Intelligence Overview

EPSS Score
0.0%
Top 98% exploitable
Prevalence
High
widely used image processing library in web and server deployments
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
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 Yes
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

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

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