LokiCMS admin.php文件绕过安全限制漏洞


添加时间:
2008-10-04

系统编号:
WAVDB-01180
BUGTRAQ: 29448

影响版本:
LokiCMS 0.3.4

程序介绍:

LokiCMS是一款简单易用的网络内容管理系统。

漏洞分析:

LokiCMS的admin.php文件中存在逻辑错误,如果远程攻击者在所提交的HTTP POST请求中设置了LokiACTION和其他参数的话,则无需管理权限就可以设置CMS main settings。

以下是有漏洞的代码段:

# admin.php Lines:24-42
 

 
  1. if ( isset ( $_POST ) && isset ( $_POST['LokiACTION'] ) && strlen ( trim ( $_POST['LokiACTION'] )  
  2. ) > 0 ) {  
  3.     // we have an action to do  
  4.     switch ( trim ( $_POST['LokiACTION'] ) ) {  
  5.         case 'A_LOGOUT'// Logout  
  6.             unset($_SESSION[PATH]);  
  7.             break;  
  8.           
  9.         case 'A_LOGIN'// Login  
  10.             if ( isset ( $_POST['login'] ) && sha1 ( $_POST['login'] ) == $c_password )  
  11.                 $_SESSION[PATH] = 'logged in lokicms030';  
  12.             break;  
  13.           
  14.         case 'A_SAVE_G_SETTINGS'//save main settings  
  15.             writeconfig ( $c_password$_POST['title'], $_POST['header'], $_POST['tagline'],  
  16. $_POST['footnote'], $c_default$_POST['theme'], $_POST['language'], $_POST['modrewrite'],  
  17. $_POST['simplelink'], $_POST['code'] );  
  18.               $c_theme = $_POST['theme'];  
  19.             include PATH . '/includes/Config.php';  
  20.             include PATH . '/languages/' . $c_lang . '.lang.php';  
  21.             $msg = $lang ['admin'] ['expressionSettingsSaved'];  
  22.             break;  

# includes/Functions.php Lines:163-200

 
  1. function writeconfig ( $c_password$c_title$c_header$c_tagline$c_footnote$c_default,  
  2. $c_theme$c_lang$c_modrewrite$c_simplelink$c_code )  
  3. {  
  4.     .  
  5.     .  
  6.     .      
  7.     $config  = '<?php ' . LINEBREAK;  
  8.     $config .= '// LokiCMS Config file, You can change settings in this file or via admin.php ' .  
  9. LINEBREAK;  
  10.     $config .= '$c_password    = \'' . $c_password   . '\'; ' . LINEBREAK;  
  11.     $config .= '$c_title       = \'' . $c_title      . '\'; ' . LINEBREAK;  
  12.     $config .= '$c_header      = \'' . $c_header     . '\'; ' . LINEBREAK;  
  13.     $config .= '$c_tagline     = \'' . $c_tagline    . '\'; ' . LINEBREAK;  
  14.     $config .= '$c_footnote    = \'' . $c_footnote   . '\'; ' . LINEBREAK;  
  15.     $config .= '$c_default     = \'' . $c_default    . '\'; ' . LINEBREAK;  
  16.     $config .= '$c_theme       = \'' . $c_theme      . '\'; ' . LINEBREAK;  
  17.     $config .= '$c_lang        = \'' . $c_lang       . '\'; ' . LINEBREAK;  
  18.     $config .= '$c_modrewrite  = '   . $c_modrewrite . '; ' . LINEBREAK;  
  19.     $config .= '$c_simplelink  = '   . $c_simplelink . '; ' . LINEBREAK;  
  20.     $config .= '$c_code        = '   . $c_code       . '; ' . LINEBREAK;  
  21.     $config .= '?>';  
  22.       
  23.     $handle = fopen ( 'includes/Config.php''w' );  
  24.     fwrite ( $handle$config );  
  25.     fclose ( $handle );  
  26. }  


解决方案:
厂商补丁:
LokiCMS
-------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.lokicms.com/

信息来源:
<*来源:alireza hassani
链接:http://marc.info/?l=bugtraq&m=121225339718904&w=2
http://secunia.com/advisories/30472/
*>