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- Range: = 7.0.7-25
- osv-coords14 versionspkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP2pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%20for%20Raspberry%20Pi%2012%20SP2pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2011%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP2pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2011%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP2pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Workstation%20Extension%2012%20SP2pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Workstation%20Extension%2012%20SP3
< 6.8.8.1-71.47.1+ 13 more
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.4.3.6-78.40.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.4.3.6-78.40.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.4.3.6-78.40.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
- (no CPE)range: < 6.8.8.1-71.47.1
Patches
0No 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- usn.ubuntu.com/3681-1/mitrevendor-advisoryx_refsource_UBUNTU
- www.securityfocus.com/bid/103498mitrevdb-entryx_refsource_BID
- github.com/ImageMagick/ImageMagick/issues/1025mitrex_refsource_CONFIRM
- lists.debian.org/debian-lts-announce/2020/08/msg00030.htmlmitremailing-listx_refsource_MLIST
News mentions
0No linked articles in our index yet.