CVE-2026-56361: ImageMagick Off-By-One Heap Buffer Read Vulnerability
ImageMagick versions before 7.1.2-19 contain a subtle off-by-one error in how they validate morphology parameters. This flaw allows attackers to read data from a single memory location just outside the intended buffer boundary. An attacker would need to craft a malicious image or morphology parameter and have a local user open it, potentially leaking a small amount of sensitive information from memory.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 3.3 LOW · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
- Weaknesses (CWE)
- CWE-125
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-30 / 2026-07-02
NVD description (verbatim)
ImageMagick before 7.1.2-19 contains an off-by-one error in morphology validation allowing out-of-bounds heap buffer reads. Attackers can trigger heap buffer overflow by providing incorrect morphology parameters causing single pixel memory access violations.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
An off-by-one error in ImageMagick's morphology validation logic fails to properly bounds-check array indices, resulting in out-of-bounds heap buffer read access. The vulnerability is triggered when morphology operations receive incorrectly specified parameters, causing the code to access memory one position beyond the allocated buffer. This manifests as a heap buffer read overflow rather than write, limiting immediate code execution risk but enabling information disclosure through memory content leakage.
Business impact
The information disclosure potential of this vulnerability is constrained by its low CVSS score and local attack vector. Organizations should not expect operational disruption or widespread risk unless ImageMagick processes untrusted image files from external sources in security-sensitive contexts. However, environments where users routinely work with user-supplied images or where batch image processing occurs may face incremental risk of memory content leakage.
Affected systems
ImageMagick prior to version 7.1.2-19 is affected. Organizations should inventory deployments where ImageMagick is installed as a library dependency, embedded in web applications, or used for command-line image processing. Common affected contexts include legacy web applications with image upload functionality, content management systems using ImageMagick for thumbnail generation, and server-side image processing pipelines.
Exploitability
Exploitation requires local access and user interaction; an attacker must either convince a local user to process a malicious image or have direct ability to supply morphology parameters to an ImageMagick operation. The single-pixel read scope means reliable exploitation for meaningful data extraction is difficult and non-deterministic. No public exploit code or weaponized attack vectors are known, and the vulnerability does not appear on CISA's Known Exploited Vulnerabilities catalog.
Remediation
Update ImageMagick to version 7.1.2-19 or later. Verify the update is applied to all systems running ImageMagick, including embedded instances within application dependencies. Test functionality after patching, as morphology operations may be affected by the validation fix. For systems unable to patch immediately, restrict local user access to ImageMagick and disable morphology-based image processing workflows if operationally feasible.
Patch guidance
Upgrade ImageMagick to 7.1.2-19 or any subsequent release. Verify patch installation using the ImageMagick version command (identify -version or convert -version). Update package managers on Linux systems (apt, yum, brew) to retrieve the patched version. For environments where ImageMagick is embedded in application dependencies, check software bill of materials (SBOM) and coordinate application updates with vendors. After patching, confirm that image processing workflows continue to function correctly, particularly those using morphology operations.
Detection guidance
Review system inventory for ImageMagick installations and version numbers. Check application and library dependencies for bundled ImageMagick versions. Monitor for image processing errors or memory access warnings in application logs following the CVE publication. Detect exploitation attempts indirectly by monitoring for segmentation faults or memory access violations in processes using ImageMagick, though this is non-specific. Evaluate whether your organization's threat model includes scenarios where local attackers can supply morphology parameters to ImageMagick.
Why prioritize this
Despite affecting a widely-used image processing library, this vulnerability merits lower priority due to its limited scope: off-by-one reads are inherently difficult to exploit reliably, the attack requires local access and user interaction, information disclosure is constrained to a single pixel's worth of memory, and no active exploitation is documented. Prioritize patching systems that expose morphology functionality to untrusted input or where batch image processing from external sources occurs, but standard deployments can follow regular patch schedules.
Risk score, explained
The CVSS 3.1 score of 3.3 (LOW) reflects the constrained attack vector (local only), required user interaction, and limited impact (availability only, via memory access violation). The off-by-one nature of the flaw prevents reliable information disclosure or code execution, keeping the severity low despite being a real memory safety issue. Organizations with strong local access controls and limited user-supplied image processing face minimal practical risk.
Frequently asked questions
Can this vulnerability be exploited remotely?
No. The vulnerability requires local access to the system and user interaction to trigger. An attacker cannot exploit this through a network request to a web application unless they have already gained local system access.
What is the difference between a heap buffer read and write overflow?
A read overflow (this case) allows attackers to leak memory content but not modify it directly. A write overflow is more dangerous as it can corrupt data or hijack program flow. Read overflows are typically used for information disclosure attacks, such as leaking encryption keys or sensitive data from adjacent memory.
Do I need to update ImageMagick if I only use it for basic image conversions without morphology operations?
Yes. Patch all ImageMagick installations to the fixed version to eliminate the vulnerability. While morphology operations are specific features, an attacker could still craft an image that triggers the off-by-one error if other code paths expose similar validation logic.
What should I check in my SBOM to see if I'm affected?
Search your software bill of materials for 'ImageMagick' or 'libmagick' with any version prior to 7.1.2-19. Check both direct dependencies and transitive dependencies pulled in by content management systems, web frameworks, or image processing libraries.
This analysis is based on publicly disclosed vulnerability data current as of the stated publication date. CVSS scores and severity ratings are sourced from official advisories and may be subject to revision. Patch version numbers and affected product versions should be verified against official vendor advisories before deployment. This explainer does not constitute security advice tailored to your organization's specific environment; consult your security team and risk management processes. No exploit code or detailed attack steps are provided. Organizations must conduct their own risk assessment based on their ImageMagick deployment footprint and threat model. Source: NVD (public-domain), retrieved 2026-08-09. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-56362LOWImageMagick Heap Buffer Overflow in GetPixelIndex
- CVE-2026-56367LOWImageMagick PSB Integer Overflow Information Disclosure
- CVE-2026-56370LOWImageMagick Out-of-Bounds Access in ConnectedComponentsImage()
- CVE-2026-56374LOWImageMagick FTXT Heap Buffer Overflow (Low Severity)
- CVE-2026-56378LOWImageMagick PCD Heap Out-of-Bounds Read
- CVE-2026-42326MEDIUMImageMagick IPTC Out-of-Bounds Read (Medium, 5.1 CVSS)
- CVE-2026-45358MEDIUMImageMagick Off-by-One Meta Encoder Information Disclosure
- CVE-2026-45359MEDIUMImageMagick Heap Buffer Over-Read in Connected Components