漏洞信息详情
Avenger’s News System目录遍历漏洞
- CNNVD编号:CNNVD-200205-124
- 危害等级: 高危
- CVE编号:
CVE-2002-0307
- 漏洞类型:
输入验证
- 发布时间:
2002-02-21
- 威胁类型:
远程
- 更新时间:
2006-06-15
- 厂 商:
avengers_news_system - 漏洞来源:
“b0iler _”※ b0iler… -
漏洞简介
Avenger\’\’s News System (ANS)是用Perl编写的基于表单的WEB更新、管理工具,可运行于绝大多数Unix/Linux系统上。
ANS没有过滤URL请求中的\”../\”,容易遭受目录遍历攻击,导致任意WEB Server进程有权读取的文件内容泄漏。
在ANS的配置文件中定义了$QUERY变量
<define QUERY>\”$ENV{\’\’QUERY_STRING\’\’}\”
ANS实现中存在如下代码处理URL POST请求
if (substr($QUERY, 0, 2) eq \”p=\”)
{
$plugin = substr((split /&/, $QUERY)[0], 2);
if (index(\”$QUERY\”, \”&\”) < 0) { $QUERY = \”\”; }
else { $QUERY = substr($QUERY, index(\”$QUERY\”,
\”&\”)+1); }
open (PLUGIN, \”$FILE_LOCATION/$plugin\”);
@plugin = <PLUGIN>;
close (PLUGIN);
eval(\”@plugin\”);
exit;
}
注意到这里未对用户输入做\”../\”过滤。
漏洞公告
临时解决方法:
“b0iler _” (b0iler@hotmail.com)建议您采取以下措施以降低威胁:
* 把程序中的以下代码:
if (substr($QUERY, 0, 2) eq “p=”)
{
$plugin = substr((split /&/, $QUERY)[0], 2);
if (index(“$QUERY”, “&”) < 0) { $QUERY = “”; }
else { $QUERY = substr($QUERY, index(“$QUERY”,
“&”)+1); }
open (PLUGIN, “$FILE_LOCATION/$plugin”);
@plugin =
close (PLUGIN);
eval(“@plugin”);
exit;
}
改为:
if (substr($QUERY, 0, 2) eq “p=”){
$QUERY =~ s/([\&;\`’\\\|”*?~<>^\(\)\[\]\{\}\$\n\r])/\\$1/g; # 过滤某些转义字符
$QUERY =~ s/\.\.//g; #filter double dot (..)
$plugin = substr((split /&/, $QUERY)[0], 2);
if (index(“$QUERY”, “&”) < 0) { $QUERY = “”; }
else { $QUERY = substr($QUERY, index(“$QUERY”, “&”)+1); }
open (PLUGIN, “<$FILE_LOCATION/$plugin”); #added a < to the open() –
readonly
@plugin =
close (PLUGIN);
eval(“@plugin”);
exit;
}
厂商补丁:
Avenger
——-
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://ans.gq.nu/” target=”_blank”>
http://ans.gq.nu/
参考网址
来源: BUGTRAQ
名称: 20020221 “Cthulhu xhAze” – Command execution in Ans.pl
链接:http://marc.theaimsgroup.com/?l=bugtraq&m=101430868616112&w=2
来源: BID
名称: 4147
链接:http://www.securityfocus.com/bid/4147