ImageMagick DCM and XCM Buffer Overflows Let Remote Users Execute Arbitrary Code
SecurityTracker Alert ID: 1017839|
SecurityTracker URL: http://securitytracker.com/id/1017839
(Links to External Site)
Updated: Apr 17 2008|
Original Entry Date: Apr 2 2007
Execution of arbitrary code via network, User access via network|
Fix Available: Yes Vendor Confirmed: Yes |
Version(s): prior to 6.3.3-5|
A vulnerability was reported in ImageMagick. A remote user can cause arbitrary code to be executed on the target user's system.|
A remote user can create a specially crafted file that, when loaded by the target user or target application, will trigger an integer overflow or heap overflow and execute arbitrary code on the target system. The code will run with the privileges of the target user or target application that uses the ImageMagick library.
A specially crafted Digital Imaging and Communications in Medicine (DCM) file can trigger a heap overflow in the ReadDCMImage() function.
A specially crafted X Windows Dump (XWD) file can trigger an integer overflow in the the ReadXWDImage() function. The 'colors' and 'comment' parameters are affected.
The vendor was notified on February 28, 2007.
iDefense reported this vulnerability.
A remote user can create a file that, when loaded by the target user or application, will execute arbitrary code on the target system.|
The vendor has issued a fixed version (6.3.3-5).|
Vendor URL: www.imagemagick.org/ (Links to External Site)
|Underlying OS: Linux (Any), UNIX (Any), Windows (Any)|
This archive entry has one or more follow-up message(s) listed below.|
Source Message Contents
Subject: iDefense Security Advisory 03.31.07: Multiple Vendor ImageMagick|
Multiple Vendor ImageMagick DCM and XWD Buffer Overflow Vulnerabilities
iDefense Security Advisory 03.31.07
Mar 31, 2007
ImageMagick is used as a suite of image manipulation tools (animate,
composite, conjure, convert, display, identify, import, mogrify, and
montage) which are sometimes used by other applications for processing
image files. For more information about ImageMagick visit the following
Remote exploitation of several buffer overflow vulnerabilities in
ImageMagick, as included in various vendors' operating system
distributions, allows attackers to execute arbitrary code with the
credentials used for image processing.
An integer overflow exists ImageMagick's handling of DCM (Digital
Imaging and Communications in Medicine) format files which allows an
attacker to cause a heap-based buffer overflow. This vulnerability
specifically exists in the ReadDCMImage() function.
Two integer overflows exists ImageMagick's handling of XWD (X Windows
Dump) format files that allows an attacker to cause a heap-based buffer
overflow. The vulnerabilities specifically exist in the ReadXWDImage()
function. An integer overflow could occur when calculating the amount
of memory to allocate for the 'colors' or 'comment' field.
Exploitation of these vulnerabilities allows attackers to execute
arbitrary code in the context of the user that started the affected
program. Since the tools that are part of ImageMagick are sometimes
used as helper tools by web applications, this user may be the same as
the httpd user.
To exploit these vulnerabilities, an attacker would need to get a
maliciously constructed image file processed by one of the affected
applications. This could be accomplished by uploading to a
web-application or using social engineering tactics.
While neither aforementioned format is widely used, ImageMagick does not
determine the file type by its extension, allowing it to be disguised as
another file type.
iDefense has confirmed the existence of these vulnerabilities in
ImageMagick version 6.3.x. Additionally, the source code for versions
6.3.1, 6.3.2, 6.3.3-3 and 6.2.9 contain the affected code. It is
suspected that earlier versions of ImageMagick are also vulnerable.
Exposure to these vulnerabilities can be mitigated by moving or deleting
the DCM and XWD module files from the ImageMagick modules directory.
However, this will remove support for these image formats altogether.
VI. VENDOR RESPONSE
The ImageMagick maintainers have addressed these vulnerabilities in
version 6.3.3-5 of ImageMagick.
VII. CVE INFORMATION
A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not
been assigned yet.
VIII. DISCLOSURE TIMELINE
02/28/2007 Initial vendor notification
03/20/2007 Initial vendor response
03/31/2007 Coordinated public disclosure
The discoverer of this vulnerability wishes to remain anonymous.
Get paid for vulnerability research
Free tools, research and upcoming events
X. LEGAL NOTICES
Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically,
please e-mail firstname.lastname@example.org for permission.
Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct,
indirect, or consequential loss or damage arising from use of, or
reliance on, this information.