CVE-2017-12662
Description
ImageMagick 7.0.6-2 has a memory leak in WritePDFImage when memory allocation fails, which can exhaust memory via crafted files.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
ImageMagick 7.0.6-2 has a memory leak in WritePDFImage when memory allocation fails, which can exhaust memory via crafted files.
Vulnerability
In ImageMagick version 7.0.6-2, the function WritePDFImage in coders/pdf.c has a memory leak vulnerability. When AcquireVirtualMemory fails, the allocated xref array is not freed before throwing an exception, leaking memory. The leak occurs at two points in the function (lines 1992 and 2092) where RelinquishMagickMemory(xref) was missing [1]. The issue is triggered during PDF output processing when converting images, such as via the convert command [2].
Exploitation
An attacker needs to provide a crafted image file that, when processed by ImageMagick's convert tool (or any use of WritePDFImage), causes a memory allocation failure. This can be achieved by crafting an image with excessively large dimensions or otherwise exhausting memory. No special privileges are required beyond the ability to supply a malicious file to a vulnerable ImageMagick instance [2]. The memory leak accumulates over successive operations, eventually leading to denial of service.
Impact
Successful exploitation leads to progressive memory exhaustion (denial of service) as leaked memory is not reclaimed. The vulnerability does not provide code execution or data exfiltration; it is a resource exhaustion issue with high availability impact (CVSS 8.8) [2].
Mitigation
The fix is commit bd40cc5f53067322861b881485cbd70f509f3829 [1], released as part of ImageMagick version 7.0.6-3 or later. Users should upgrade to a patched version. If patching is not immediately possible, avoid processing untrusted image files with PDF output. No workaround other than upgrading is documented.
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
18cpe:2.3:a:imagemagick:imagemagick:7.0.6-2:*:*:*:*:*:*:*+ 1 more
- cpe:2.3:a:imagemagick:imagemagick:7.0.6-2:*:*:*:*:*:*:*
- (no CPE)range: =7.0.6-2
- osv-coords16 versionspkg:rpm/suse/GraphicsMagick&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2011%20SP4pkg:rpm/suse/GraphicsMagick&distro=SUSE%20Studio%20Onsite%201.3pkg: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
< 1.2.5-4.78.28.2+ 15 more
- (no CPE)range: < 1.2.5-4.78.28.2
- (no CPE)range: < 1.2.5-4.78.28.2
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.4.3.6-7.78.14.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.4.3.6-7.78.14.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.4.3.6-7.78.14.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
- (no CPE)range: < 6.8.8.1-71.17.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
3- github.com/ImageMagick/ImageMagick/commit/bd40cc5f53067322861b881485cbd70f509f3829nvdPatchVendor Advisory
- github.com/ImageMagick/ImageMagick/issues/576nvdIssue TrackingPatchVendor Advisory
- www.securityfocus.com/bid/100232nvdThird Party AdvisoryVDB Entry
News mentions
0No linked articles in our index yet.