Cacti多个SQL注入漏洞
发布日期:2005-07-04
更新日期:2005-07-04
受影响系统:Raxnet Cacti <= 0.8.6e
不受影响系统:Raxnet Cacti 0.8.6f
描述:
BUGTRAQ ID:
14128
Cacti是一款轮循数据库(RRD)工具,可帮助从数据库信息创建图形,有多个Linux版本。
Cacti中存在多个SQL注入漏洞:
/* ================= input validation ================= */
input_validate_input_regex(get_request_var("rra_id"), "^([0-9]+|all)$");
input_validate_input_number(get_request_var("local_graph_id"));
/* ==================================================== */
if ($_GET["rra_id"] == "all") {
$sql_where = " where id is not null";
}else{
$sql_where = " where id=" . $_GET["rra_id"];
}
这段代码看起来是安全的,因为它在向SQL查询中注入rra_id请求参数之前检查了参数是数字或是字符串“all”。
但在get_request_var()实现中:
function get_request_var($name, $default = "")
{
if (isset($_REQUEST[$name]))
{
return $_REQUEST[$name];
} else
{
return $default;
}
}
这意味着实际上是对$_REQUEST["rra_id"]而不是$_GET["rra_id"]的内容应用了过滤。$_REQUEST是$_GET,$_POST和$_COOKIE数组合并的版本,因此相同名称的数组key会在$_REQUEST中相互覆盖。
在PHP的默认配置中合并顺序是GPC,这意味着如果请求中同时包含$_GET["rra_id"]和$_POST["rra_id"]的话,仅有张贴的值会在$_REQUEST数组中结束,因此攻击者可以通过在URL中提供攻击字符串以及通过POST或COOKIE提供特制字符串,绕过几乎所有的过滤。
<*来源:Stefan Esser (
s.esser@ematters.de)
链接:
http://marc.theaimsgroup.com/?l=bugtraq&m=112033853117909&w=2
*>
建议:
厂商补丁:
Raxnet
------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载0.8.6f版本:
http://www.cacti.net/download_cacti.php浏览次数:4257
严重程度:0(网友投票)