1

X-Frame-Options: DENY是网站防止他人将自己嵌入到iframe.

然而,除了仅仅扼杀网络之外,X-Frame-Options在其他情况下它显然是相当无用的。

如果我是在我网站的 iframe 中嵌入不受信任的来源的人怎么办?而且我将这种不受信任的来源放在一个iframe中,这样的 iframe 会直接损害我自己的视觉元素吗?

下面是我所说的一个简化示例:

<!DOCTYPE html>
<title>blah</title>
<style type='text/css'>
    body {
        margin: 0;
    }
    header {
        /* can example.com/untrusted break into this? */
        z-index:    1;
        position:   absolute;
        background-color:   rgba(224, 224, 224, 0.8);
        padding: 2em;
    }
    iframe {
        /* out of this? */
        position:   absolute;
        border: 0;
        width:  100%;
        height: 100%;
    }
</style>
<body>
    <header>
    <a href="/trusted/confirm-purchase">buy this immediately!</a>
    </header>
<iframe
    src='http://example.com/untrusted'
    width='800' height='480'
    seamless='seamless'
>
</iframe>
</body>

我一切都好吗,或者http://example.com/untrusted的运营商可以在我的页面上形成一个成功的攻击向量?有什么要找的吗?

4

0 回答 0