积极预防 及时发现
快速响应 力保恢复
Oracle9i程序服务器存在格式串缺陷 (Other,缺陷)
发布时间:2003-02-22 信息来源:管理员

涉及程序: Oracle9i程序服务器 9.0.2版 描述: Oracle9i程序服务器存在格式串缺陷 详细: Oracle9i程序服务器是一款功能强大的web服务器,整合了Oracle数据库服务器。Oracle9i程序服务器支持很多基于web的应用程序,例如:Java/JSP, PL/SQL, Perl 和FastCGI等。 在最新的Oracle9.0.2版本中,加入了对WebDAV(Web Distributed Authoring and Versioning)的支持。DAV是默认运行的,攻击者利用格式串缺陷能匿名上传文件到服务器。如果攻击者使用COPY方法,提供一个特殊设置和端口的URL,将返回网关响应,并导致触发格式串缺陷。通过精心构造一个临时的字符串,并将其发送到服务器,攻击者能在任意地址内写入任意代码,将导致攻击者获得web服务器的控制权。 攻击方法: 示例代码: From mod_dav.c revision 1.157 .. .. lookup = dav_lookup_uri(dest, r); if (lookup.rnew == NULL) { if (lookup.err.status == HTTP_BAD_REQUEST) { ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,lookup.err.desc); return HTTP_BAD_REQUEST; } return dav_error_response(r, lookup.err.status, lookup.err.desc); } .. .. This code calls the dav_lookup_uri() function in dav_util.c. From dav_util.c revision 1.84 .. dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r) { .. .. if (strcasecmp(comp.scheme, scheme) != 0 || comp.port != port) { result.err.status = HTTP_BAD_GATEWAY; result.err.desc = ap_psprintf(r->pool, \"Destination URI refers to different \" \"scheme or port (%s://hostname:%d)\\n\" \"(want: %s://hostname:%d)\", comp.scheme ? comp.scheme : scheme, comp.port ? comp.port : port, scheme, port); return result; .. .. } When dav_lookup_uri() returns to mod_dav.c the format strings occurs .. lookup = dav_lookup_uri(dest, r); if (lookup.rnew == NULL) { if (lookup.err.status == HTTP_BAD_REQUEST) { // THIS IS THE FIRST FORMAT STRING VULNERABILITY ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,lookup.err.desc); .. .. } Of course the code should have read ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,\"%s\",lookup.err.desc); to not be vulnerable. 解决方案: Oracle已公布该缺陷的补丁: http://otn.oracle.com/deploy/security/pdf/2003alert52.pdf 同时,Oracle还提供该缺陷的检测工具,详情请查看: http://www.nextgenss.com/software/orascan.html