CVE-2018-8960
Description
In ImageMagick 7.0.7-26 Q16, a malformed TIFF image triggers a heap-buffer-over-read in ReadTIFFImage, leading to denial of service or possible code execution.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In ImageMagick 7.0.7-26 Q16, a malformed TIFF image triggers a heap-buffer-over-read in ReadTIFFImage, leading to denial of service or possible code execution.
Vulnerability
The ReadTIFFImage function in coders/tiff.c of ImageMagick 7.0.7-26 Q16 does not properly restrict memory allocation when processing specially crafted TIFF files. This leads to a heap-based buffer over-read. The issue affects the version 7.0.7-26 as reported [1][2].
Exploitation
An attacker must craft a malicious TIFF image that, when processed by ImageMagick (e.g., using the convert command), triggers the heap-buffer-overflow. No special authentication or network access is required if the victim opens the file with ImageMagick. The referenced exploit shows that conversion of a tif_heap-buffer-overflow file causes an AddressSanitizer error indicating a heap-buffer-overflow read of 4 bytes at a controlled location [2].
Impact
Successful exploitation could cause a denial of service (crash) or potentially allow arbitrary code execution with the privileges of the user running ImageMagick. The Ubuntu security notice lists this as a denial of service or possible code execution [1].
Mitigation
Ubuntu has released fixed versions in USN-3681-1, updating imagemagick packages for Ubuntu 18.04 LTS (bionic) and other releases [1]. Users should update to the patched package versions. The ImageMagick project likely addressed this in later releases; upgrading to a version beyond 7.0.7-26 is recommended [2].
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
9- Range: =7.0.7-26 Q16
- osv-coords8 versionspkg: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%20SP3pkg: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%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2011%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Workstation%20Extension%2012%20SP3
< 6.8.8.1-71.54.5+ 7 more
- (no CPE)range: < 6.8.8.1-71.54.5
- (no CPE)range: < 6.4.3.6-78.45.1
- (no CPE)range: < 6.8.8.1-71.54.5
- (no CPE)range: < 6.4.3.6-78.45.1
- (no CPE)range: < 6.8.8.1-71.54.5
- (no CPE)range: < 6.4.3.6-78.45.1
- (no CPE)range: < 6.8.8.1-71.54.5
- (no CPE)range: < 6.8.8.1-71.54.5
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"The ReadTIFFImage function in ImageMagick does not properly restrict memory allocation, leading to a heap-based buffer over-read."
Attack vector
An attacker can trigger this vulnerability by providing a specially crafted TIFF image file to the ImageMagick `convert` utility. When the `ReadTIFFImage` function processes this malicious file, it fails to correctly manage memory allocations. This leads to an out-of-bounds read operation on the heap, potentially causing a crash or other unintended behavior [ref_id=1].
Affected code
The vulnerability resides in the `ReadTIFFImage` function, located in the `coders/tiff.c` file. The issue arises from improper memory allocation handling within this function, which is called during the image reading process [ref_id=1].
What the fix does
The patch addresses the heap-based buffer over-read by ensuring proper validation of memory allocation sizes within the `ReadTIFFImage` function. By correctly checking and limiting the amount of memory allocated, the vulnerability is mitigated, preventing out-of-bounds reads and subsequent crashes [ref_id=1].
Preconditions
- inputA specially crafted TIFF image file.
Reproduction
root@vultr:/opt/poc# convert tif_heap-buffer-overflow dev/null ================================================================= ==13394==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60c00000c97c at pc 0x7f856a3bc674 bp 0x7ffc3e5db890 sp 0x7ffc3e5db880 READ of size 4 at 0x60c00000c97c thread T0 #0 0x7f856a3bc673 in ReadTIFFImage coders/tiff.c:2018 [ref_id=1]
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/103523mitrevdb-entryx_refsource_BID
- github.com/ImageMagick/ImageMagick/issues/1020mitrex_refsource_MISC
- lists.debian.org/debian-lts-announce/2020/08/msg00030.htmlmitremailing-listx_refsource_MLIST
News mentions
0No linked articles in our index yet.