VYPR
Unrated severityNVD Advisory· Published Mar 20, 2018· Updated Aug 5, 2024

CVE-2018-8804

CVE-2018-8804

Description

ImageMagick 7.0.7-25 has a double-free vulnerability in WriteEPTImage that can cause denial of service or potential code execution via a crafted file.

AI Insight

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

ImageMagick 7.0.7-25 has a double-free vulnerability in WriteEPTImage that can cause denial of service or potential code execution via a crafted file.

Vulnerability

WriteEPTImage in coders/ept.c of ImageMagick 7.0.7-25 Q16 triggers a double-free when processing a crafted EPT file. The function calls WritePS2Image, which writes JPEG data; the double-free occurs via ResizeMagickMemory during memory reallocation in the JPEG compression termination [1][2]. The condition is reachable when a user converts a specially crafted image to an EPT format using tools like convert.

Exploitation

An attacker must trick a user or automated system (e.g., a web service using ImageMagick) into processing a malicious image file. No special privileges or network position are required; the exploit is triggered by simply opening or converting the crafted file, as demonstrated by a convert command [2]. The double-free is a memory corruption bug that can be reliably triggered without race conditions.

Impact

Successful exploitation causes a denial of service via application crash, as shown by the AddressSanitizer double-free error [2]. The Ubuntu advisory notes that this could also lead to arbitrary code execution with the privileges of the user invoking ImageMagick [1]. The impact is limited to the security context of the running application, potentially allowing an attacker to execute code or corrupt memory.

Mitigation

Ubuntu released fixed packages in USN-3681-1 (2018-08-16) for all supported releases, including 18.04 LTS (bionic) [1]. Users should upgrade to the latest ImageMagick version (e.g., imagemagick-6.q16 8:6.9.7.4+dfsg-16ubuntu6.3) [1]. For other distributions, apply vendor patches or update to a version containing the fix. No workaround is available; the vulnerability is fully addressed by updating.

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

15

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"A double free vulnerability exists in the EPT image coder due to improper memory management."

Attack vector

A remote attacker can cause a denial of service or application crash by providing a crafted EPT file to ImageMagick. The vulnerability is triggered during the processing of this file, leading to a double free error in the memory management functions.

Affected code

The vulnerability resides in the `WriteEPTImage` function within the `coders/ept.c` file. The ASAN output indicates that the double free occurs in `MagickCore/memory.c` during calls originating from `WriteBlob` and ultimately within `WriteEPTImage`.

What the fix does

The patch addresses the double free vulnerability by ensuring that memory is not freed multiple times. Specifically, it modifies the `WriteEPTImage` function in `coders/ept.c` to correctly handle memory allocation and deallocation, preventing the erroneous second free operation that leads to the crash.

Preconditions

  • inputThe attacker must provide a crafted EPT file.

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

References

4

News mentions

0

No linked articles in our index yet.