CVE-2019-13307
Description
Heap-buffer-overflow in ImageMagick 7.0.8-50 Q16's EvaluateImages due to incorrect allocation size using thread count instead of image rows.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Heap-buffer-overflow in ImageMagick 7.0.8-50 Q16's EvaluateImages due to incorrect allocation size using thread count instead of image rows.
Vulnerability
The vulnerability is a heap-buffer-overflow in AcquirePixelThreadSet within MagickCore/statistic.c. The function allocates memory based on number_threads (from the thread resource limit) but then iterates over rows (the number of images in the list). When the number of images exceeds the thread limit, a write beyond the allocated buffer occurs in EvaluateImages at line 559. Affected versions include ImageMagick 7.0.8-50 Q16 and likely earlier versions with similar code. The issue was reported in GitHub issue #1615 [1].
Exploitation
An attacker can trigger the overflow by providing a crafted command line that processes multiple images, for example using -evaluate-sequence Median with multiple input images. The reproducer from [1] is: magick -seed 0 -monitor -bias 63 "(" magick:rose -colorize 172,35,77 ")" "(" magick:logo +repage ")" -crop 507x10'!'+20-54 -evaluate-sequence Median tmp. No authentication or special privileges are required; the attacker only needs to invoke ImageMagick with a maliciously crafted sequence of images.
Impact
Successful exploitation results in a heap-buffer-overflow, which can cause a crash (denial of service) or potentially allow arbitrary code execution depending on memory layout. The ASAN log in [1] shows a write of size 8 at a location 0 bytes to the right of a 256-byte region. The overflow occurs within the ImageMagick process, which may have access to user data.
Mitigation
The fix was committed in ImageMagick 7 commit 025e77f [3] and ImageMagick6 commit 91e58d9 [2]. The fix changes the allocation to use rows (the maximum of the image list length and the thread resource limit) instead of number_threads. Users should update to a version containing these commits (e.g., ImageMagick 7.0.8-51 or later). No workaround is available; the vulnerability is fixed in the patched versions.
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
13- ImageMagick/ImageMagickdescription
- Range: 7.0.8-50 Q16
- osv-coords11 versionspkg:rpm/opensuse/ImageMagick&distro=openSUSE%20Leap%2015.0pkg:rpm/opensuse/ImageMagick&distro=openSUSE%20Leap%2015.1pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP1pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP1pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP4pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Workstation%20Extension%2012%20SP4
< 7.0.7.34-lp151.7.9.1+ 10 more
- (no CPE)range: < 7.0.7.34-lp151.7.9.1
- (no CPE)range: < 7.0.7.34-lp151.7.9.1
- (no CPE)range: < 6.8.8.1-71.126.1
- (no CPE)range: < 7.0.7.34-3.67.1
- (no CPE)range: < 7.0.7.34-3.67.1
- (no CPE)range: < 7.0.7.34-3.67.1
- (no CPE)range: < 7.0.7.34-3.67.1
- (no CPE)range: < 6.8.8.1-71.126.1
- (no CPE)range: < 6.8.8.1-71.126.1
- (no CPE)range: < 6.8.8.1-71.126.1
- (no CPE)range: < 6.8.8.1-71.126.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Synthesis attempt was rejected by the grounding validator. Re-run pending.
References
7- lists.opensuse.org/opensuse-security-announce/2019-08/msg00069.htmlmitrevendor-advisoryx_refsource_SUSE
- usn.ubuntu.com/4192-1/mitrevendor-advisoryx_refsource_UBUNTU
- www.debian.org/security/2020/dsa-4712mitrevendor-advisoryx_refsource_DEBIAN
- www.debian.org/security/2020/dsa-4715mitrevendor-advisoryx_refsource_DEBIAN
- github.com/ImageMagick/ImageMagick/commit/025e77fcb2f45b21689931ba3bf74eac153afa48mitrex_refsource_MISC
- github.com/ImageMagick/ImageMagick/issues/1615mitrex_refsource_MISC
- github.com/ImageMagick/ImageMagick6/commit/91e58d967a92250439ede038ccfb0913a81e59femitrex_refsource_MISC
News mentions
0No linked articles in our index yet.