了解第三方iframe的安全性? [英] Understanding 3rd party iframes security?

查看:186
本文介绍了了解第三方iframe的安全性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook和其他人提供了我可以放在我的网站上的小iframe snipplet。
示例:

Facebook and others offer little iframe snipplets that I can put in my site. Example:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://example.com"
        scrolling="no" frameborder="0"
        style="border:none; width:450px; height:80px"></iframe>

我想知道的是,如果我将此代码放在我的身边,可以使用代码他们加载到我的页面访问我的页面的DOM?我看到了一些安全问题。如果是这样的话。

What I'd like to know is, if I put this code inside my side, could the code they load into my page access the DOM of my page? I see some security isssues if so.

同样,facebook允许我将iframe放入他们的网站,这就是facebook应用程序的工作方式。
我可以从包含我的iframe的任何页面中挖掘任何数据吗?

Likewise facebook allows me to put an iframe into their site, this is how facebook applications work. Could I then mine any data off any page that contains my iframe?

注意我在这里以facebook为例,但是很多公司做同样的事情所以这个问题不是以任何方式特定于facebook,所以我没有这样标记。

Note I used facebook as an example here, but many companies do the same thing so this quesiton is not specific to facebook in any way so I am not tagging it as such.

父页面也可以访问iframe的DOM吗?

Also can the parent page access the DOM of the iframe?

推荐答案

实际上有 iframes的继承。这是同源政策的一部分,我强烈建议您阅读整个Google浏览器手册。

Actually there are specific rules of inheritance for iframes. This is apart of the same-origin policy, and I highly recommend reading the entire Google Browser Sec Handbook.

这篇关于了解第三方iframe的安全性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆