Windows Metafile vulnerability

From HandWiki

The Windows Metafile vulnerability—also called the Metafile Image Code Execution and abbreviated MICE—is a security vulnerability in the way some versions of the Microsoft Windows operating system handled images in the Windows Metafile format. It permits arbitrary code to be executed on affected computers without the permission of their users. It was discovered on December 27, 2005, and the first reports of affected computers were announced within 24 hours. Microsoft released a high-priority update to eliminate this vulnerability via Windows Update on January 5, 2006.[1] Attacks using this vulnerability are known as WMF exploits.

The vulnerability was located in gdi32.dll and existed in all versions of Microsoft Windows from Windows 3.0 to Windows Server 2003 R2. However, attack vectors only exist in NT-based versions of Windows (Windows NT, Windows 2000, Windows XP and Windows Server 2003). Exploits taking advantage of the vulnerability on Windows NT-based systems facilitated the propagation of various types of malware, typically through drive-by downloads.

Due to extreme impact, this bug won the 2007 Pwnie Award for "Mass 0wnage" and "Breaking the Internet".

Affected systems

All versions of the Microsoft Windows operating system support the Windows Metafile graphics standard. All versions from Windows 3.0 to Windows Server 2003 R2 contain this security flaw.[2] However, Windows NT 4.0 and Windows XP, unless patched, are more vulnerable than earlier versions because their default installation enables Windows Metafile code execution, the source of the vulnerability.[3] Later versions of Windows do not have this vulnerability.[2]

According to computer security expert Steve Gibson, Windows NT 4 is vulnerable to known exploits if image preview is enabled.[3] Windows operating systems that do not have image preview enabled or that have hardware-based Data Execution Prevention (DEP) active for all applications should not be susceptible to this exploit.[4]

Operating systems other than Windows (e.g., macOS, Unix, Linux, etc.) are not directly affected. However, a non-Windows system could become vulnerable if it runs software to view Windows WMF files. This could include software that incorporates or clones Windows' native Graphics Device Interface (GDI) Dynamic-link library (DLL)[1] or that run Windows or Windows programs through an emulator or compatibility layer. A Unix-like system that uses Wine to emulate Windows, for example, could be exploited.Cite error: Closing </ref> missing for <ref> tag[5]

Propagation and infection

Computers can be affected via the spread of infected e-mails which carry the hacked WMF file as an attachment. Infection may also result from:

  • Viewing a website in a web browser that automatically opens WMF files, in which case any potential malicious code may be automatically downloaded and opened. Internet Explorer, the default Web browser for all versions of Microsoft Windows since 1996 through Windows 10, does this.
  • Previewing an infected file in Windows Explorer.
  • Viewing an infected image file using some vulnerable image-viewing programs.
  • Previewing or opening infected emails in older versions of Microsoft Outlook and Outlook Express.
  • Indexing a hard disk containing an infected file with Google Desktop.
  • Clicking on a link through an instant messaging program such as Windows Live Messenger, AOL Instant Messenger (AIM) or Yahoo! Messenger.

Other methods may also be used to propagate infection. Because the problem is within the operating system, using non-Microsoft browsers such as Firefox or Opera does not provide complete protection. Users are typically prompted to download and view a malicious file, infecting the computer. Infected files may be downloaded automatically, which opens the possibility for infection by disk indexing or accidental previewing.

According to assessments from the McAfee antivirus company,[2] the vulnerability has been used to propagate the Bifrost backdoor trojan horse. Other forms of malware have also exploited the vulnerability to deliver various malicious payloads.

McAfee claims that the first generation of such exploits had been encountered by more than 6% of their customer base by December 31, 2005.

Official patch

Microsoft released an official patch to address the problem on January 5, 2006.[6] This patch may be applied in lieu of other corrective measures.

The official patch is available for Windows 2000, Windows XP and Microsoft Windows Server 2003. Windows NT 4 and other older operating systems did not receive a patch as they were no longer supported by Microsoft by then. Steve Gibson stated in his Security Now! podcast No. 20, that his company Gibson Research Corporation would make a patch available for Windows 9x systems if Microsoft did not.[7] After further research, Steve Gibson stated, in a later Security Now! podcast No. 23, that Windows 9x and ME are not vulnerable and do not need patching.[8] Windows 9x/ME users can run his Mouse Trap utility to see this for themselves.

A free downloadable patch for Windows NT[9] has been provided by Paolo Monti from Future Time, the Italian distributor of Eset's NOD32 anti-virus system. The patch works on older operating systems, but it is supplied without warranty.

There have been reports of the official patch being automatically installed even when Windows Automatic Update is configured to ask before installing automatically downloaded updates. This causes an automatic reboot, which can cause loss of data if the user has a program open with unsaved changes.[3]

Other corrective measures

These measures are of historical interest only on systems updated on or after January 5, 2006.

Workaround

As a workaround before a patch was available,[4] on December 28, 2005, Microsoft advised Windows users to unregister the dynamic-link library file shimgvw.dll (which can be done by executing the command regsvr32.exe /u shimgvw.dll from the Run menu or the command prompt) which invokes previewing of image files and is exploited by most of these attacks. The DLL can be re-registered after patching by running regsvr32.exe shimgvw.dll. This workaround blocks a common attack vector but does not eliminate the vulnerability.

Third-party patch

A third party patch[5] was released by Ilfak Guilfanov on December 31, 2005, to temporarily disable the vulnerable function call in gdi32.dll. This unofficial patch received much publicity due to the unavailability of an official one from Microsoft, receiving the recommendation of SANS Institute Internet Storm Center[6] and F-Secure.[7] Because of the large amount of publicity, including being indirectly slashdotted,[8] Guilfanov's website received more visitors than it could cope with, and was suspended on January 3, 2006; the patch was still available for download from a number of mirrors including the Internet Storm Center website.[9]

Guilfanov's website went back online on January 4 in a much-reduced state. No longer providing the patch on-site due to bandwidth issues, the homepage provided a list of mirrors where a user could download the patch and the associated vulnerability-checker, and the MD5 checksum for the file, so that it could be checked that a downloaded file was probably genuine.

After Microsoft released its patch, Guilfanov withdrew his.

Risk reduction techniques

Microsoft says its patch removes the flawed functionality in GDI32 that allowed the WMF vulnerability. For computers running an unpatched version of Windows, a defence in depth approach was recommended, to mitigate the risk of infection. Various sources have recommended mitigation efforts that include:

  • Making use of hardware-enforced Data Execution Prevention[10] effective for all applications.
  • Set the default WMF application to be one not susceptible to infection, such as Notepad.
  • Do not use Internet Explorer, or at least turn off downloads by setting the default security settings to high.
  • Keep all anti-virus software up-to-date. Consider frequent manual updates.
  • Block all WMF files on the network perimeter by file-header filtering.
  • Making use of users accounts that are configured with only the user rights that are required.
  • Disable image loading in Internet Explorer and all other browsers.[11]
  • Disable image loading in Outlook Express.[12]
  • Disable hyperlinks in MSN Messenger.
  • Disable the Indexing Service on Windows 2000, Windows XP and Windows Server 2003.
  • Disable Desktop Search applications such as Google Desktop or Windows Desktop Search until the problem is corrected.

According to SANS Institute Internet Storm Center article, using a web browser other than Internet Explorer may offer additional protection against this vulnerability.[10] Depending on settings, these browsers may ask the user before opening an image with the .wmf extension, but this only reduces the chance of opening the maliciously crafted Windows Metafile, and does not protect against the vulnerability being exploited as these browsers still open the metafile if it is masquerading as another format. It is better to entirely disable image loading in any browser used.

Accusations

In 2006 Steve Gibson suggested that the peculiar nature of the 'bug' was an indication that the vulnerability was actually a backdoor intentionally engineered into the system.[11] The accusation became an assertion and spread through the internet as a rumor after the technology news website Slashdot picked up Gibson's speculation.[11] The rumor was widely debunked[12][13] and Thomas Greene, writing in The Register, attributed Gibson's mistake to "his lack of security experience" and called him a "popinjay expert".[11]

Notes

  1. ^ Security Watch: Iniquitous Images Imperil the Internet!, Larry Seltzer, PC Magazine.
  2. ^ A Description of the Image Preview Feature in Windows Millennium Edition, Microsoft.
  3. ^ sunbeltblog.blogspot.com Microsoft clarifies DEP issue
  4. ^ Library for non-Windows operating systems to run WMF files.
  5. ^ Linux/BSD still exposed to WMF exploit through WINE, ZDNet.
  6. ^ It's not a bug, it's a feature, F-Secure.
  7. ^ Exploit-WMF, by McAfee
  8. ^ Microsoft Security Advisory (912840) - Vulnerability in Graphics Rendering Engine Could Allow Remote Code Execution, Microsoft Official Advisory on the vulnerability.
  9. ^ http://www.hexblog.com/2005/12/wmf_vuln.html, unofficial patch by Ilfak Guilfanov.
  10. ^ Trustworthy Computing, SANS Institute Internet Storm Center.
  11. ^ Ilfak to the rescue!, F-Secure.
  12. ^ Trustworthy Computing, Slashdot. Linking to SANS Institute Internet Storm Center's article titled Trustworthy Computing (see above).
  13. ^ .MSI installer file for WMF flaw available, SANS Institute Internet Storm Center.
  14. ^ How to Configure Memory Protection in Windows XP SP2, software-enforced Data Execution Prevention (DEP) feature in Microsoft Windows XP SP 2.
  15. ^ How to improve browsing performance in Internet Explorer (KB153790), Microsoft.
  16. ^ Images are blocked when you open an e-mail message in Outlook Express on a Windows XP Service Pack 2-based computer (KB843018), Microsoft.
  17. ^ http://www.nod32.ch/en/download/tools.php Unofficial WMF patch by Paolo Monti distributed by ESET.
  18. ^ http://blogs.securiteam.com/index.php/archives/210 Unofficial Windows 98SE patch by Tom Walsh.

References

  1. "Microsoft Releases Security Update to Fix Vulnerability in Windows", PressPass (Microsoft), January 5, 2006, https://www.microsoft.com/presspass/press/2006/jan06/01-05UpdatePR.mspx 
  2. 2.0 2.1 "Microsoft Security Bulletin MS06-001 – Critical". TechNet. Microsoft. January 5, 2006. https://technet.microsoft.com/en-us/security/bulletin/ms06-001. 
  3. 3.0 3.1 Gibson, Steve (January 19, 2006). "M.I.C.E.: Metafile Image Code Execution". Gibson Research Corporation. http://www.grc.com/wmf/wmf.htm. 
  4. Eckelberry, Alex (December 31, 2005). "Microsoft Clarifies 'DEP' Issue". GFI Blog. GFI Software. 
  5. "New exploit blows by fully patched Windows XP systems". 28 December 2005. http://www.gfi.com/blog/new-exploit-blows-by-fully-patched-windows-xp-systems/. 
  6. "Technical documentation, API, and code examples". https://www.microsoft.com/technet/security/Bulletin/ms06-001.mspx. 
  7. "GRC | Security Now! Transcript of Episode #20". http://www.grc.com/sn/SN-020.htm. 
  8. "GRC | Security Now! Transcript of Episode #23". http://www.grc.com/sn/SN-023.htm. 
  9. Downloadable patch for Windows NT by Paolo Monti
  10. Frantzen, Swa, "WMF FAQ", InfoSec Handlers Diary Blog (SANS Institute Internet Storm Center), http://isc.sans.org/diary.php?storyid=994 
  11. 11.0 11.1 11.2 Greene, Thomas C. (January 21, 2006). "Windows back door rumor is bunk". The Register. Situation Publishing Ltd.. https://www.theregister.co.uk/2006/01/21/wmf_fud_from_grc/. 
  12. Stephen Toulouse for Microsoft Security Response Center. January 13, 2006 Looking at the WMF issue, how did it get there?
  13. Otto Helweg for Mark Russinovich's Blog. January 18, 2006 Inside the WMF Backdoor

External links