Mbedthis AppWeb URL协议格式串处理漏洞
发布日期:2007-06-12
更新日期:2007-06-15
受影响系统:Mbedthis Software Mbedthis AppWeb HTTP server 2.0.5-4
描述:
BUGTRAQ ID:
24454
CVE(CAN) ID:
CVE-2007-3009
Mbedthis Software AppWeb是一款HTTP服务程序。
AppWeb在处理URL的协议部分时存在格式串错误,远程攻击者可能利用此漏洞导致拒绝服务。
在MprLogToFile::logEvent()函数中,如果没有定义实际的文件描述符,就会将一些错误记录到STDERR,执行以下调用:
======= start code ============
if (logFd < 0 && level <= 1) {
//
// Always output fatal and error messages
//
mprFprintf(MPR_STDERR, buf);
return;
}
// OPT -- could get length above
write(logFd, buf, strlen(buf));
========= end code ==========
如果用户提交的GET请求包含有特殊字符的话,如:
"GET %n://localhost:80/index.html HTTP/1.1..Host: 172.19.15.11..User-Agent: Security test..Content-Length: 0..Cache-Control: no-cache....\r\n\r\n"
"GET %s%s://localhost:80/index.html HTTP/1.1..Host: 172.19.15.11..User-Agent: Security test..Content-Length: 0..Cache-Control: no-cache....\r\n\r\n"
"GET %d://localhost:80/index.html HTTP/1.1..Host: 172.19.15.11..User-Agent: Security test..Content-Length: 0..Cache-Control: no-cache....\r\n\r\n"
服务器无法找到这样的页面,于是试图向stderr写入错误消息。当将上述字符串做为buf参数传送给mprFprintf时,mprFprintf(更具体来讲是mprSprintfCore)试图将%s(或%d、%s)匹配到列表的参数,但列表中根本就不存在参数,这就导致出现分段错误,守护程序会崩溃。成功利用这个漏洞要求启用了日志功能但appweb.conf中没有ErrorLog指令。
<*来源:Nir Rachmel
链接:
http://secunia.com/advisories/25641/
http://www.appwebserver.org/forum/viewtopic.php?t=969
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
GET %n://localhost:80/" request
建议:
临时解决方法:
* 在appweb.conf中设置ErrorLog指令。
厂商补丁:
Mbedthis Software
-----------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.mbedthis.com/浏览次数:2906
严重程度:0(网友投票)