首页 -> 安全研究

安全研究

安全漏洞
htdig 泄漏web服务器文件路径

发布日期:2000-04-27
更新日期:2000-04-27

受影响系统:
htDig 3.1.5 (stable release)
htDig 3.2 (beta release)
描述:

在htDig的CGI程序中存在一个安全隐患,可以将htDig的配置文件路径泄漏给远程攻击者。
这允许远程攻击者搜集系统信息以便进行下一步的攻击。
问题出在'config'变量中,当提供一个不存在的配置文件名时,htDig会报告一个错误,说
它不能找到该配置文件,在错误信息中包含了配置文件的全物理路径。

<* 来源: Geoff Hutchison (ghutchis@wso.williams.edu)  *>



测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

输入下列超级链接:

http://www.victim.com/cgi-bin/htsearch?config=blahblah

htdig会返回类似下面的错误信息;

ht://Dig error
htsearch detected an error. Please report this to the webmaster of this site. The error message is:

Unable to read configuration file '/servers/htdig//conf/blahblah.conf'


建议:
临时补丁程序:


Index: htsearch.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htsearch/htsearch.cc,v
retrieving revision 1.24.2.9
diff -c -3 -p -r1.24.2.9 htsearch.cc
*** htsearch.cc    2000/02/15 22:20:02    1.24.2.9
--- htsearch.cc    2000/04/19 12:20:47
*************** main(int ac, char **av)
*** 149,156 ****
      }
      if (access(configFile, R_OK) < 0)
      {
!     reportError(form("Unable to read configuration file '%s'",
!              configFile.get()));
      }
      config.Read(configFile);
  
--- 149,155 ----
      }
      if (access(configFile, R_OK) < 0)
      {
!     reportError("Unable to read configuration file");
      }
      config.Read(configFile);
  
*************** main(int ac, char **av)
*** 248,277 ****
      String    word_db = config["word_db"];
      if (access(word_db, R_OK) < 0)
      {
!     reportError(form("Unable to read word database file '%s'\nDid you run
htmerge?",
!              word_db.get()));
      }
      ResultList    *results = htsearch(word_db, searchWords, parser);
  
      String    index = config["doc_index"];
      if (access(index, R_OK) < 0)
      {
!     reportError(form("Unable to read document index file '%s'\nDid you run
htmerge?",
!              index.get()));
      }
      String    doc_db = config["doc_db"];
      if (access(doc_db, R_OK) < 0)
      {
!     reportError(form("Unable to read document database file '%s'\nDid you
run htmerge?",
!              doc_db.get()));
      }
  
      Display    display(index, doc_db);
      if (display.hasTemplateError())
        {
!     reportError(form("Unable to read template file '%s'\nDoes it exist?",
!                          config["template_name"]));
!     return 0;
        }
      display.setOriginalWords(originalWords);
      display.setResults(results);
--- 247,271 ----
      String    word_db = config["word_db"];
      if (access(word_db, R_OK) < 0)
      {
!     reportError("Unable to read word database file\nDid you run htmerge?");
      }
      ResultList    *results = htsearch(word_db, searchWords, parser);
  
      String    index = config["doc_index"];
      if (access(index, R_OK) < 0)
      {
!     reportError("Unable to read document index file\nDid you run
htmerge?");
      }
      String    doc_db = config["doc_db"];
      if (access(doc_db, R_OK) < 0)
      {
!     reportError("Unable to read document database file\nDid you run
htmerge?");
      }
  
      Display    display(index, doc_db);
      if (display.hasTemplateError())
        {
!     reportError("Unable to read template file\nDoes it exist?");
        }
      display.setOriginalWords(originalWords);
      display.setResults(results);


浏览次数:6209
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障