English
◀◁ 뒤로
취약점ID 22182
위험도 40
포트 80, ...
프로토콜 TCP
분류 WWW
상세설명 해당 Sun ONE Application 서버는 NSAPI Connector 모듈에 버퍼 오버플로우 취약점을 가지고 있다. 이 모듈은 Sun ONE 웹 서버 (이전 명칭으로 iPlanet Enterprise Server)를 Application 서버와 연동시켜주는 NSAPI (Netscape Application Programming Interface) 플러그인이다. 이 Connector Module (gxnsapi6.dll)은 입력받는 요청 URL의 처리 과정에서 Static 버퍼를 사용한다. 만약, 원격지 공격자들이 "/[AppServerPrefix]/[long buffer]" 형태로 어플리케이션 서비스의 prefix 뒤에 아주 긴 문자열을 덧붙여 서버에 요청하면, 메모리의 중요한 부분을 덮어쓸 수 있다. 이는 원격지의 공격자들이 버퍼를 오버플로우(Buffer Overflow)시키고 잠재적으로는 서버 상에서 임의의 코드를 실행할 수 있게 해 준다.

* 영향을 받는 플랫폼:
Sun ONE Application Server 6.0
Sun ONE Application Server 6.5
Microsoft Windows Any version
해결책 Sun ONE Application 서버 6.5의 경우:
다음 Sun의 웹 사이트를 참조하여 SP1, 혹은 그 이상의 서비스 팩을 설치해야 한다:
http://docs.oracle.com/cd/E19485-01/816-6373-11/rn_65sp1.html#UpgradingtoSP1

임시 조치방법으로 서버가 입력 요청의 길이를 검사하도록 @stake 에 의해 제안된 모듈을 사용하거나 유사하게 NASPI 모듈을 변경한다:

=============================
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 -----
관련 URL CVE-2002-0387 (CVE)
관련 URL 7082 (SecurityFocus)
관련 URL 11529 (ISS)