Executive brief
ImageMagick, a widely used software suite for displaying and editing images, is vulnerable to a memory-related flaw. By tricking a user or an automated system into processing a specially crafted image file, an attacker can cause the application to crash. This can lead to a denial-of-service, disrupting business operations that rely on automated image processing or web-based image uploads.
Technical details
A heap-based buffer overflow exists in the WaveletDenoiseImage function within MagickCore/fx.c. The vulnerability is caused by an off-by-one error in memory allocation where the 'kernel' buffer is allocated using AcquireQuantumMemory without accounting for an additional required element. An attacker can exploit this by providing a specially crafted image that triggers the wavelet denoise operation, leading to a memory corruption and subsequent crash. The issue is resolved in versions 6.9.6-4 and 7.0.3-6 by incrementing the allocation size by one.
Affected products
- ImageMagick ImageMagick before 6.9.6-4, 7.x before 7.0.3-6
Timeline
- 2016-11-13: disclosed: Vulnerability reported on oss-security mailing list
- 2016-11-14: advisory: CVE-2016-9298 assigned
- 2017-01-27: advisory: NVD publication date
References
- http://www.openwall.com/lists/oss-security/2016/11/13/1
- http://www.openwall.com/lists/oss-security/2016/11/14/10
- http://www.securityfocus.com/bid/94310
- https://github.com/ImageMagick/ImageMagick/commit/3cbfb163cff9e5b8cdeace8312e9bfee810ed02b
- https://github.com/ImageMagick/ImageMagick/issues/296
- https://security.gentoo.org/glsa/201702-09