首页 -> 安全研究

安全研究

安全漏洞
Postaci 任意SQL命令插入漏洞

发布日期:2001-01-23
更新日期:2001-01-23

受影响系统:

Umut Gokbayrak Postaci 1.1.3
Umut Gokbayrak Postaci 1.1.2
   + Debian Linux 2.2

描述:

BUGTRAQ  ID:2230
CVE(CAN) ID: CAN-2001-0201
   
Postaci是一个开放源码的免费多用户webmail接口软件。后台是SQL数据库。由
Umut Gokbayrak开发和维护。

此软件存在一个安全问题允许远程用户向数据库服务器传输恶意请求。这影响使
用PostgreSQL作为后台数据库的Postaci实现,而使用MySQL的实现不受影响。

问题出在deletecontact.php中:
--- deletecontact.php ---

1    // security check
2    $dbq = $db->execute("select user_id from tblAdressbook where
item_id=$item_id");
3    $auth_user = $dbq->fields['user_id'];
4    if ($auth_user != $user_id) {
5      Header("Location: index.php?error_id=1");
6    }
7    $dbq->close();
8      if ($log_id == ""){
9        Header("Location: index.php?error_id=1");
10     } else {
11
12       $dbq = $db->execute("delete from tblAdressbook where item_id=\
13                      $item_id and user_id = $user_id");
14       $dbq->close();
15
16       Header("Location: adressbook.php");
17     }
--- deletecontact.php ---

由于没有检查$item_id是否为数字,攻击者可以在此变量中输入SQL语句。如果
数据库支持使用分号来分隔两条SQL语句,攻击者就可能在数据库中执行任意的
操作,数据库数据可能被更改或者删除。

<*来源: Berk Demir (berk@linux.org.tr) *>


测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!



设置$item_id变量的值为:
"144 OR TRUE; select user_id from tblAdressbook where item_id=144"
这将导致tblAdressbook表的内容被删除。

建议:

临时解决方法:
检查item_id是否为数字类型。

厂商补丁:
暂无

浏览次数:5878
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障