CVE-2026-25796

ImageMagick has memory leak of watermark Image object in ReadSTEGANOImage on multiple error/early-return paths

Published Feb 24, 2026 CVSS 3.1 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 7.1.2-15 and 6.9.13-40, in `ReadSTEGANOImage()` (`coders/stegano.c`), the `watermark` Image object is not freed on three early-return paths, resulting in a definite memory leak (~13.5KB+ per invocation) that can be exploited for denial of service. Versions 7.1.2-15 and 6.9.13-40 contain a patch.

Analysis

AI-generated

Technical impact

ImageMagick, a widely used image manipulation library, contains a memory leak in the ReadSTEGANOImage function for versions prior to 7.1.2‑15 and 6.9.13‑40. When a caller reaches one of three early‑return paths, the watermark image object is not freed, leaking roughly 13.5 KB per invocation. Repeated processing of untrusted images can exhaust system memory and cause the image‑processing application or host to become unresponsive, resulting in a denial‑of‑service scenario. The vulnerability is a classic example of improper resource management (CWE‑401) and an unreleased resource destruction issue (CWE‑772).

Affected Systems

The vulnerable products are ImageMagick versions preceding 7.1.2‑15 and 6.9.13‑40. Systems running ImageMagick 7.1.2‑15 or newer, and 6.9.13‑40 or newer, contain the patch that frees the watermark image object properly. Any environment that employs older ImageMagick builds, such as web servers, content‑generation services, or local utilities that accept user‑supplied images, is susceptible.

Risk and Exploitability

The CVSS vector assigns a score of 5.3, indicating a moderate severity. The EPSS score is below 1 %, suggesting that attacks are currently unlikely, and the vulnerability is not listed in the CISA KEV catalog. Nevertheless, exploiting the leak requires only feeding crafted images to a running ImageMagick instance. If an application processes external images without bounds, an attacker can trigger the early‑return paths repeatedly, gradually consuming memory until a service crash or restart occurs. The overall risk is moderate, especially for high‑availability or high‑traffic image services.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade ImageMagick to version 7.1.2‑15 or later, or 6.9.13‑40 and newer, where the watermark image is correctly freed.
  • When an upgrade is not immediately possible, configure the image‑processing environment to enforce strict memory limits or run ImageMagick in a sandboxed process so that a memory leak does not affect the entire host.
  • Validate or sanitize all incoming images before handing them to ImageMagick to reduce the chance of intentionally crafted images triggering the leak.

Generated by OpenCVE AI on April 17, 2026 at 16:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4497-1 imagemagick security update
Debian DSA Debian DSA DSA-6158-1 imagemagick security update
Debian DSA Debian DSA DSA-6159-1 imagemagick security update
Debian DSA Debian DSA DSA-6210-1 imagemagick security update
Github GHSA Github GHSA GHSA-g2pr-qxjg-7r2w ImageMagick has memory leak of watermark Image object in ReadSTEGANOImage on multiple error/early-return paths
Ubuntu USN Ubuntu USN USN-8127-1 ImageMagick vulnerabilities
Ubuntu USN Ubuntu USN USN-8263-1 ImageMagick vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
CPEs cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Imagemagick
Imagemagick imagemagick
Vendors & Products Imagemagick
Imagemagick imagemagick
Type Values Removed Values Added
Description ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 7.1.2-15 and 6.9.13-40, in `ReadSTEGANOImage()` (`coders/stegano.c`), the `watermark` Image object is not freed on three early-return paths, resulting in a definite memory leak (~13.5KB+ per invocation) that can be exploited for denial of service. Versions 7.1.2-15 and 6.9.13-40 contain a patch.
Title ImageMagick has memory leak of watermark Image object in ReadSTEGANOImage on multiple error/early-return paths
Weaknesses CWE-401
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}

Weaknesses
  • CWE-401

    Missing Release of Memory after Effective Lifetime

  • CWE-772

    Missing Release of Resource after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Feb 26, 2026, 3:12 PM
Reserved
Feb 5, 2026, 7:58 PM
Status
Analyzed
Published
Feb 24, 2026, 1:16 AM
Modified
Jun 17, 2026, 10:25 AM
Severity
Moderate
Public date
Feb 24, 2026, 12:57 AM