Vulnerability Note VU#611008

Microsoft MFC FindFile function heap buffer overflow

Original Release date: 20 Sep 2007 | Last revised: 21 Sep 2007


A buffer overflow vulnerability in the Microsoft Foundation Class (MFC) Library could allow an attacker to execute arbitrary code on an affected system.


The Microsoft Foundation Class (MFC) Library is a Microsoft library that wraps parts of the Windows API in C++ classes. The MFC libraries contain a function called FindFile(). The FindFile() function manages file searches across a filesystem, enabling users to specify the type of file to search.

MFC is included in Microsoft Visual Studio and Microsoft Windows. MFC is also used by other many other Windows applications such as Hewlett-Packard All-in-One and in Hewlett-Packard Photo and Imaging Gallery. Note, however, that the use of MFC library is not necessarily limited to these applications; other applications may also be using the vulnerable libraries. Additionally, the list of vendors under the "Systems Affected" section of this vulnerability may not be an exhaustive list.

The MFC42 and MFC71 libraries contain a heap-based buffer overflow vulnerability in the FindFile() function's argument handling. This vulnerability could allow an attacker to execute arbitrary code or cause a denial of service.


An attacker may be able to execute arbitrary code in the context of an application that uses the vulnerable function. The scope of the impact depends on how the affected application works. Applications that process filename input from the network, such as some web applications, would be vulnerable to a remote attacker. Applications that only process filename input from a local user would only be vulnerable to a local attacker.
Note that applications may be linking to the MFC library dynamically or statically. It will be necessary to recompile any applications that are statically linked to the MFC library.


We are currently unaware of a practical solution to this problem.

Note, however, that the MFC libraries can be used by multiple applications on most systems. Once a solution is made available by the vendor, it may be necessary for application users (system administrators, developers) to upgrade or apply multiple patches and then recompile statically linked applications.

Applications that are statically linked must be recompiled using patched libraries. Applications that are dynamically linked do not need to be recompiled; however, running services need to be restarted in order to use the patched libraries.

System administrators should consider the following process when addressing this issue:

  1. Patch or obtain updated MFC libraries.
  2. Restart any dynamically linked services that make use of the MFC libraries.
  3. Recompile any statically linked applications using the patched or updated MFC libraries.

Note this is an iterative process for each set of patches being applied.

Systems Affected (Learn More)

VendorStatusDate NotifiedDate Updated
Hewlett-Packard CompanyAffected-19 Sep 2007
Microsoft CorporationAffected-19 Sep 2007
If you are a vendor and your product is affected, let us know.

CVSS Metrics (Learn More)

Group Score Vector
Base N/A N/A
Temporal N/A N/A
Environmental N/A N/A



This vulnerability was reported by Jonathan Sarba of GoodFellas Security Research Team.

This document was written by Joseph Pruszynski.

Other Information

  • CVE IDs: CVE-2007-4916
  • Date Public: 14 Sep 2007
  • Date First Published: 20 Sep 2007
  • Date Last Updated: 21 Sep 2007
  • Severity Metric: 12.93
  • Document Revision: 32


If you have feedback, comments, or additional information about this vulnerability, please send us email.