Firefox混合内容拦截器绕过漏洞:CVE-2015-4483与feed:协议利用

本文详细分析了CVE-2015-4483漏洞,该漏洞允许通过feed:协议和POST方法绕过Firefox的混合内容拦截器,导致不安全脚本加载,影响包括Google Analytics在内的多个网站。

CVE-2015-4483: Firefox混合内容拦截器绕过与feed:协议

今天,我想分享CVE-2015-4483的详细信息。此漏洞已在Firefox 40中修复。安全公告在此。

通常,Firefox可以如下方式阻止混合内容: https://mkpocapp.appspot.com/bug1148732/victim

但使用feed:协议和POST方法如下,我们可以绕过它:

http://l0.cm/fx_mixed_content_blocker_bypass.html

1
2
3
<form action="feed:https://mkpocapp.appspot.com/bug1148732/victim" method="post">
<input type="submit" value="go">
</form>

要利用此漏洞,我们需要目标https:网站中的http:资源。因此,您可能认为这样的网站从一开始就存在问题。但请等一下!我认为此漏洞影响许多网站。

请访问以下页面并查看location.protocol:

http://l0.cm/fx_location_protocol_and_feed.html

location.protocol返回"feed:"。接下来,让我们看看Google Analytics跟踪代码。

1
2
3
4
5
6
7
8
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxx-y']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

让我们看一下红色js代码。如果location.protocol不是"https:",不安全的ga.js(http://www.google-analytics.com/ga.js)将被加载到页面中。结合"location.protocol==feed:“技巧,会发生什么?是的,我们可以通过GA跟踪代码加载不安全的js!:)

例如,我们可以在accounts.google.com中加载不安全的js,如下所示: http://l0.cm/google/accounts.google.com_mixedscripting.html

Firefox 40可以正确阻止混合内容。但似乎我们仍然可以将"feed:“字符串放入URL的协议部分。

谢谢!

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计