VYPR
Unrated severityNVD Advisory· Published Sep 23, 2019· Updated Aug 5, 2024

CVE-2019-16708

CVE-2019-16708

Description

ImageMagick 7.0.8-35 has a memory leak in magick/xwindow.c via XCreateImage, leading to resource exhaustion.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

ImageMagick 7.0.8-35 has a memory leak in magick/xwindow.c via XCreateImage, leading to resource exhaustion.

Vulnerability

ImageMagick version 7.0.8-35 contains a memory leak in the magick/xwindow.c file, specifically in the XCreateImage function [1]. The leak occurs when the convert command writes an image to an X11 output format (e.g., output.x). The code path involves XMakeImage, XConfigureImage, and XDisplayImage, which allocate memory that is not properly freed, resulting in a cumulative memory leak of 48136 bytes per operation [1].

Exploitation

An attacker can trigger the memory leak by providing a crafted image file and running the ImageMagick convert command with an X11 output target (e.g., magick convert input output.x) [1]. No authentication or special privileges are required; the attacker only needs to convince a user to process a malicious image file. The leak is reproducible on Linux systems and does not require any race condition or user interaction beyond executing the command [1].

Impact

Successful exploitation leads to a memory leak that can exhaust system resources over repeated invocations, potentially causing a denial-of-service condition [1]. The leak is per-operation, so an attacker who can repeatedly trigger the conversion can degrade system performance or cause the application to crash due to memory exhaustion.

Mitigation

As of the publication date (2019-09-23), no official patch has been released for this issue [1]. Users are advised to avoid using X11 output formats (e.g., .x) if not necessary, or to monitor the ImageMagick project for updates that address the memory leak. Upgrading to a version newer than 7.0.8-35 may include a fix, but the reference does not specify a fixed version [1].

AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

17

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"Memory leak in XCreateImage when processing XWD output files — allocated image data is never freed."

Attack vector

An attacker provides a crafted image file (e.g., a specially constructed XWD file) that triggers the ImageMagick display or convert pipeline. When the tool writes the image to an X11 output (via `WriteXImage` → `XDisplayImage` → `XConfigureImage` → `XMakeImage`), the `XCreateImage` call allocates memory that is never released [ref_id=1]. The leak occurs during normal image processing without requiring any special privileges beyond the ability to supply a malicious image file.

Affected code

The memory leak occurs in `magick/xwindow.c` at the `XMakeImage` function (line 5733), which calls `XCreateImage` without freeing the allocated memory [ref_id=1]. The call chain flows through `magick/display.c` (`XConfigureImage` at line 4449, `XDisplayImage` at line 15069) and `coders/x.c` (`WriteXImage` at line 202).

What the fix does

No patch is included in the bundle. The advisory [ref_id=1] identifies the leak in `magick/xwindow.c` related to `XCreateImage`, with the call chain showing allocations in `XMakeImage` (xwindow.c:5733) that are not freed. The remediation would require ensuring that the `XImage` structure and its data buffer returned by `XCreateImage` are properly deallocated (e.g., via `XDestroyImage`) after use in the display/output codepath.

Preconditions

  • inputAttacker supplies a crafted image file that triggers the X11 output codepath.
  • networkNo network access required; the attack is local file-based.

Reproduction

1. Create an empty output file: `touch output.x` 2. Run: `/usr/local/bin/magick convert Memory-Leak-2 output.x` 3. Close the ImageMagick windows that appear. 4. The AddressSanitizer report shows 48,136 bytes leaked in 2 allocations from `XCreateImage` and `XMakeImage` [ref_id=1].

Generated on May 25, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.