CVE-2018-14435
Description
ImageMagick 7.0.8-4 has a memory leak in the DecodeImage function in coders/pcd.c that can be triggered via a crafted PCD image.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
ImageMagick 7.0.8-4 has a memory leak in the DecodeImage function in coders/pcd.c that can be triggered via a crafted PCD image.
Vulnerability
In ImageMagick 7.0.8-4 and possibly earlier versions, the DecodeImage() function in coders/pcd.c contains a memory leak. A buffer is allocated at line 0x800 of AcquireQuantumMemory, but the corresponding deallocation is missing when an exception is thrown in the default branch of a switch statement at line 286 of the same file [2]. This occurs during processing of PhotoCD (PCD) images.
Exploitation
An attacker would need to provide a specially crafted PCD file that triggers the exception branch in the DecodeImage() function. No special privileges or network position other than the ability to submit an image to ImageMagick are required. The leak manifests each time the vulnerable code path is exercised.
Impact
Repeated exploitation can lead to cumulative memory exhaustion, resulting in a denial of service (DoS) condition [1]. The leak does not directly allow arbitrary code execution or information disclosure; the primary impact is availability degradation.
Mitigation
The Ubuntu security notice [1] indicates that a fix was included in the USN-3785-1 update, released on 2018-09-17, which addresses several memory leak CVEs including CVE-2018-14435. Users should upgrade their ImageMagick packages to the patched version. No workaround is documented; guarding against untrusted PCD file processing can reduce risk. The issue is not known to be listed in CISA's Known Exploited Vulnerabilities catalog.
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- Range: 7.0.8-4
- osv-coords12 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%20SP3pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015pkg:rpm/suse/ImageMagick&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015pkg: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
< 1.2.5-78.61.1+ 11 more
- (no CPE)range: < 1.2.5-78.61.1
- (no CPE)range: < 1.2.5-78.61.1
- (no CPE)range: < 6.8.8.1-71.74.1
- (no CPE)range: < 7.0.7.34-3.14.1
- (no CPE)range: < 7.0.7.34-3.14.1
- (no CPE)range: < 6.4.3.6-78.56.1
- (no CPE)range: < 6.8.8.1-71.74.1
- (no CPE)range: < 6.4.3.6-78.56.1
- (no CPE)range: < 6.8.8.1-71.74.1
- (no CPE)range: < 6.4.3.6-78.56.1
- (no CPE)range: < 6.8.8.1-71.74.1
- (no CPE)range: < 6.8.8.1-71.74.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"Missing free of allocated buffer in the exception branch of DecodeImage() in coders/pcd.c."
Attack vector
An attacker provides a crafted PCD image file that triggers the `CorruptImageError` exception path in `DecodeImage()` [ref_id=1]. When the decoder reaches the `default` case in the switch statement (line 286), `ThrowBinaryException` is called without first freeing the `buffer` allocation made at line 186, causing a memory leak [ref_id=1]. Repeatedly processing such malformed files can exhaust system memory.
Affected code
The vulnerability is in `coders/pcd.c` in the `DecodeImage()` function. Memory is allocated via `AcquireQuantumMemory(0x800,sizeof(*buffer))` at line 186, but is not freed in the exception branch at line 286 where `ThrowBinaryException(CorruptImageError,"CorruptImage", image->filename)` is called [ref_id=1].
What the fix does
The advisory does not include a patch, but the fix would require freeing the `buffer` allocation before calling `ThrowBinaryException` in the `default` exception branch at line 286 of `coders/pcd.c` [ref_id=1]. The normal branch already frees the buffer, so the missing deallocation in the error path is the sole defect [ref_id=1].
Preconditions
- inputAttacker must supply a crafted PCD image file that triggers the CorruptImageError exception path in DecodeImage()
- configThe target must process the malicious file using ImageMagick's PCD decoder
Generated on May 25, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2- usn.ubuntu.com/3785-1/mitrevendor-advisoryx_refsource_UBUNTU
- github.com/ImageMagick/ImageMagick/issues/1193mitrex_refsource_MISC
News mentions
0No linked articles in our index yet.