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

thttpd 和 mini_http 存在权限旁路问题


发布时间:2001-11-14
更新时间:2001-11-14
严重程度:
威胁程度:口令恢复
错误类型:访问验证错误
利用方式:服务器模式

受影响系统
thttpd 和 mini_http 所有版本
详细描述
问题存在于httpd守护程序处理文件请求,如果文件被标记为403,或者目录有
密码保护,thttpd可以导致远程查看这些文件。

测试代码
htaccess用密码保护木马,通过请求如下地址可以导致泄露.htpasswd文件的内容:

http://host/protected-dir/.htpasswd/

解决方案
补丁信息:

http://www.acme.com/software/thttpd/
http://www.acme.com/software/mini_httpd/
  
  
  
******************************************************************************************
                                  THTTPD VENDOR PATCH BELOW THIS LINE
******************************************************************************************
  
<--- Insert patch here --->
  
*** libhttpd.c.old Mon Nov 12 17:44:18 2001
--- libhttpd.c Mon Nov 12 16:28:42 2001
***************
*** 1422,1429 ****
         struct stat sb;
         if ( stat( path, &sb ) != -1 )
             {
! httpd_realloc_str( &checked, &maxchecked, strlen( path ) );
             (void) strcpy( checked, path );
             httpd_realloc_str( &rest, &maxrest, 0 );
             rest[0] = '\0';
             *restP = rest;
--- 1447,1461 ----
         struct stat sb;
         if ( stat( path, &sb ) != -1 )
             {
! checkedlen = strlen( path );
! httpd_realloc_str( &checked, &maxchecked, checkedlen );
             (void) strcpy( checked, path );
+ /* Trim trailing slashes. */
+ while ( checked[checkedlen - 1] == '/' )
+ {
+ checked[checkedlen - 1] = '\0';
+ --checkedlen;
+ }
             httpd_realloc_str( &rest, &maxrest, 0 );
             rest[0] = '\0';
             *restP = rest;
  
  
<--- End of patch --->

相关信息
zeno (zeno@cgisecurity.net)
参考:http://archives.neohapsis.com/archives/bugtraq/2001-11/0086.html