Public Vulnerability Reports

Microsoft Windows Graphics Device Interface Integer Overflow Vulnerability



Microsoft Windows graphics device interface (GDI) enables applications to use graphics and formatted text on both the video display and the printer. For more information about GDI, please visit the following Web page:


Remote exploitation of an integer overflow vulnerability in multiple versions of Microsoft Corp.'s Windows operating system could allow an attacker to execute arbitrary code with the privileges of the current user.

This vulnerability exists in the way GDI handles integer math. An integer overflow could occur while calculating the a buffer length, which results in an undersized heap buffer being allocated. This buffer is then overflowed with data from the input image file.


Exploitation allows an attacker to execute arbitrary code with the privileges of the current user. Exploitation would require convincing a targeted user to view a specially crafted image file. An attacker could host this file on a Web server, attach the file to an e-mail or embedded the file in an Office document.

This vulnerability also can be triggered through e-mail. If the e-mail client can automatically display images embedded in the e-mail, the user only needs to open the e-mail to trigger the vulnerability. Currently an EMF file is used as a test attack vector. Outlook and Outlook Express will automatically display EMF images and trigger the vulnerability. Lotus Notes and Thunderbird do not display EMF images in e-mail directly, but the vulnerability still can be triggered when opening or viewing the EMF attachment.


iDefense has confirmed that gdi32.dll file version 5.1.2600.3316, as included in fully patched Windows XP Service Pack 2 as of May 2008, is vulnerable. Other versions of Windows are suspected to be vulnerable.


Turning off metafile processing by modifying the registry mitigates this threat. Under registry key HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionGRE_Initialize create a DWORD entry "DisableMetaFiles" and set it to 1.

Note 1: This does not affect processes that are already running, so you might need to log off and log on again or restart the computer after making the change. Note 2: It only blocks one attack vector through Windows metafile. It is possibly to exploit this vulnerability through other attack vectors.

Impact of Workaround: components relying on metafile processing might not work properly, such as printing.

Viewing e-mail in plain text format mitigates e-mail-based attack.


"The vulnerability could allow remote code execution if a user opens a specially crafted WMF image file. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts."

Microsoft Corp. has released a patch which addresses this issue. For more information, consult their advisory at the following URL.


The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2008-2249 to this issue. This is a candidate for inclusion in the CVE list (, which standardizes names for security problems.


05/21/2008 Initial Vendor Notification
05/21/2008 Initial Vendor Reply
09/05/2008 Additional Information Provided to Vendor
10/14/2008 Additional Vendor Feedback
12/09/2008 Coordinated Public Disclosure


This vulnerability was discovered by Jun Mao of iDefense based on a submission from an anonymous contributor.

Get paid for vulnerability research

Free tools, research and upcoming events


Copyright © 2008 Verisign, Inc.

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 customer service 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.