【发布时间】:2014-01-31 13:47:34
【问题描述】:
我使用的是 Chrome 版本 31.0.1650.63 m。
最近,我注意到 Chrome 开发者控制台中出现了一些错误,但我的网站似乎没有任何问题。经调查,它们似乎与嵌入的 youtube 链接有关。有问题的标记如下:
<iframe width="560" height="315" src="http://www.youtube.com/embed/hhhrWFxWQRk" frameborder="0" allowfullscreen></iframe>
视频本身无关紧要(我只是抓住了我在 youtube 的首页上看到的第一个作为测试),但我已经在此处包含了我正在使用的链接,以防发生非常具体的事情。
在 Chrome 中发出的请求的响应头如下:
Alternate-Protocol:80:quic
Cache-Control:no-cache
Content-Encoding:gzip
Content-Length:2560
Content-Type:text/html; charset=utf-8
Date:Sun, 12 Jan 2014 20:35:54 GMT
Expires:Tue, 27 Apr 1971 19:44:06 EST
Server:gwiseguy/2.0
X-Content-Type-Options:nosniff
X-Frame-Options:ALLOWALL
X-XSS-Protection:1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
我在 Chrome 开发者控制台中遇到的错误如下:
Invalid 'X-Frame-Options' header encountered when loading 'http://www.youtube.com/embed/hhhrWFxWQRk': 'sil' is not a recognized directive. The header will be ignored.
Error parsing header X-XSS-Protection: sil: expected 0 or 1 at character position 0. The default protections will be applied.
大红字。我注意到的第一件事是错误都引用了值“sil”,我在 HTTP 请求的任何响应标头中都没有看到。
视频显示和播放正常,错误提示将使用默认设置 - 所以这看起来不是问题。不过,我很想了解发生了什么,以及为什么会出现这些错误。
我注意到错误与 XSS 有关,根据我的研究,我认为 X-XSS-Protection header is for IE8 only 和从 YouTube 返回的值是无效的(report= et al)。根据规范,X-Frame-Options 标头的值似乎是 invalid,但 Wikipedia(我知道!)引用了 ALLOWALL 选项:
除此之外,一些广告网站返回一个非标准的 ALLOWALL 值,旨在允许将其内容框架化 任何页面(相当于根本不设置 X-Frame-Options)。[31]
这是一个有效的担忧吗?这是 Chrome 解析错误、youtube 标题的问题,还是我完全没有抓住重点?
我也在 Firefox v26、IE 11.0.6600.16476 和 Opera 12.16 中做了一些测试,这些浏览器都没有出现这个错误。
【问题讨论】:
-
与 41.0.2272.118 相同,所以显然是另一回事。
标签: google-chrome youtube xss x-frame-options