如何绕过 Safari 的 XSS 审核器在 POST 上渲染远程 Flash 对象?
我有一个表单,允许您嵌入 YouTube 视频,当它发布时,它会呈现 YouTube 视频。问题是 Safari(自 5.0 起)有一个 XSS Auditor,它会抛出以下消息:拒绝加载对象。在请求中找到的 URL:“http://www.youtube.com/v/ZO7EiX5TqLY?version=3”。
对于正常的 GET 后记来说,它工作得很好。有什么办法可以在不重定向的情况下解决这个问题吗?
I have a form that allows you to embed YouTube videos, and when it POSTs it renders the YouTube video. The problem is that Safari (since 5.0) has an XSS Auditor that throws this message: Refused to load an object. URL found within request: "http://www.youtube.com/v/ZO7EiX5TqLY?version=3".
It works fine for normal GETs afterwords. Is there any way to get around this without redirecting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 #webkit 上使用
abarth
解决了这个问题:Safari 5 正在尝试阻止 反射型 XSS 攻击,不允许嵌入出现在 POSTed 参数中。
我可以做两件事:
X-XSS-Protection: 0
标头,这表明我知道自己在做什么,并且可以自己防范 XSS。I resolved this with
abarth
on #webkit:Safari 5 is trying to prevent a reflective XSS attack, by not allowing embeds that appear in the POSTed params.
There are two things I can do:
X-XSS-Protection: 0
header, which indicates that I know what I'm doing, and can protect against XSS myself.POST 规范指示重定向:
http://www.w3.org/Protocols /rfc2616/rfc2616-sec9.html
既然您说它适用于后续的 GET 请求,这是否意味着您试图直接在 POST 响应中返回嵌入的对象?如果是这样,似乎违反了规范,XSS Auditor 可能就在这里。如果我误解了这个问题,你能澄清一下吗?
The spec for POST indicates a redirect:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Since you said it works on subsequent GET requests, does that mean that you're trying to return the embedded object directly in the POST response? If so, seems against the spec, and the XSS Auditor might be in the right here. If I misunderstood the issue, can you clarify?