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

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

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

今天,我想分享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 设计