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

Sun ONE应用服务连接器NSAPI模块远程缓冲区溢出漏洞


发布时间:2003-03-28
更新时间:2003-03-28
严重程度:
威胁程度:远程管理员权限
错误类型:边界检查错误
利用方式:服务器模式

BUGTRAQ ID:7082

受影响系统
Sun ONE Application Server 6.0
Sun ONE Application Server 6.5
详细描述
Sun ONE应用服务器实现上存在漏洞,在NSAPI连接器模块中存在一个缓冲区溢出漏洞,远程攻击者可以通过向模块程序发送一个超长的URI请求来触发溢出,攻击者可能利用此漏洞覆盖内存中的某些数据导致执行任意指令。此漏洞影响Sun ONE 6.5及以前版本。

解决方案
@stake提供了一个NSAPI模块来检查HTTP请求的长度:

=============================
NSAPI Data Validation Module:
=============================

Usage:

In [server-root]/[server-instance]/config/obj.conf:

...
Init fn="load-modules" shlib="[path to libs]/long.so"
funcs="bounds_check"

<Object name=default>
# Make sure this function is the first to be called
NameTrans fn=bounds_check maxlength=500

...


----- BEGIN -----
#include "nsapi.h"

static int max_req_len = 0;

NSAPI_PUBLIC int bounds_check(pblock *pb, Session *sn,
Request *rq) {
char *temp;
max_req_len = atoi(pblock_findval("maxlength", pb));
temp = pblock_findval("uri", rq->reqpb);

if (temp != NULL) {
if (strlen(temp) > max_req_len) {
log_error(LOG_SECURITY, "bounds_check", sn, rq,
"Overly long URI header (%d bytes)...
aborting.",
strlen(temp));
protocol_status(sn, rq, 440, "Potential Attack
Detected");
return REQ_ABORTED;
}
}
return REQ_NOACTION;
}
----- END -----

相关信息
@stake

Sun ONE (iPlanet) Application Server Connector Module Overflow
http://archives.neohapsis.com/archives/bugtraq/2003-03/0204.html