Microsoft Windows MFC库文档标题更新栈溢出漏洞
SEBUG-ID:19920
SEBUG-Appdir:Microsoft Windows
Published:2010-07-05
Vulnerable:
Microsoft Windows XP SP3
Microsoft Windows XP SP2
Microsoft Windows 2000 SP4
Discription:
BUGTRAQ ID: 41333
Microsoft Windows是微软发布的非常流行的操作系统。
Windows mfc42.dll库中CFrameWnd类的UpdateFrameTitleForDocument()函数在更新文档标题时存在栈溢出漏洞,用户受骗打开了恶意的档案文件并向该函数传送了超长的标题字符串参数就可以触发这个溢出,导致执行任意代码。
<*References
http://secunia.com/advisories/40298/
*>
SEBUG Solution:
厂商补丁:
Microsoft
---------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.microsoft.com/technet/security/
// sebug.net [2010-07-07]
void CFrameWnd::UpdateFrameTitleForDocument(LPCTSTR lpszDocName)
{
CString WindowText;
if (GetStyle() & FWS_PREFIXTITLE)
{
// get name of currently active view
if (lpszDocName != NULL)
{
WindowText += lpszDocName;
// add current window # if needed
if (m_nWindow > 0)
{
TCHAR szText[32];
// :%d will produce a maximum of 11 TCHARs
wsprintf(szText, _T(":%d"), m_nWindow);
WindowText += szText;
}
WindowText += _T(" - ");
}
WindowText += m_strTitle;
}
else
{
// get name of currently active view
WindowText += m_strTitle;
if (lpszDocName != NULL)
{
WindowText += _T(" - ");
WindowText += lpszDocName;
// add current window # if needed
if (m_nWindow > 0)
{
TCHAR szText[32];
// :%d will produce a maximum of 11 TCHARs
wsprintf(szText, _T(":%d"), m_nWindow);
WindowText += szText;
}
}
}
// set title if changed, but don't remove completely
// Note: will be excessive for MDI Frame with maximized child
AfxSetWindowText(m_hWnd, (LPCTSTR) WindowText);
}