Avenger’s News System目录遍历漏洞

漏洞信息详情

Avenger’s News System目录遍历漏洞

漏洞简介

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

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享