HomeHelpTrac

Changeset 13259


Ignore:
Timestamp:
11/18/09 00:00:14 (3 years ago)
Author:
Alexander Trofimov
Message:

Ticket #1467

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/classes/BxDolInstallerUtils.php

    r13238 r13259  
    8383        $s = getParam('sys_exceptions_fields'); 
    8484        if (!$s) { 
    85             return; 
    86         }  
    87         $a = unserialize($s); 
    88         unset($a['system_email_templates']); 
     85            $a = array (); 
     86        } else { 
     87            $a = unserialize($s); 
     88            unset($a['system_email_templates']); 
     89        } 
    8990        $a['system_email_templates'] = $this->_getEmailTemplatesHtmlFields(); 
    9091        $s = serialize ($a); 
     
    9899        $s = getParam('sys_html_fields'); 
    99100        if (!$s) { 
    100             return; 
    101         }  
    102         $a = unserialize($s); 
    103         unset($a['system_profile_html']); 
     101            $a = array (); 
     102        } else { 
     103            $a = unserialize($s); 
     104            unset($a['system_profile_html']);             
     105        } 
    104106        $a['system_profile_html'] = $this->_getSystemProfileHtmlFields(); 
    105107        $s = serialize ($a); 
     
    116118        $a = $GLOBALS['MySQL']->getAll ("SELECT `Name` FROM `sys_email_templates`"); 
    117119        foreach ($a as $r) { 
    118             $aRet[] = 'POST.'.$r['Name']; 
    119             $aRet[] = 'REQUEST.'.$r['Name']; 
     120            $aRet[] = 'POST.' . $r['Name'] . '_Body'; 
     121            $aRet[] = 'REQUEST.' . $r['Name'] . '_Body'; 
     122            $aRet[] = 'POST.' . $r['Name'] . '_Subject'; 
     123            $aRet[] = 'REQUEST.' . $r['Name'] . '_Subject'; 
    120124        } 
    121125        return $aRet; 
  • trunk/inc/security.inc.php

    r13217 r13259  
    4646 
    4747        $ids = new IDS_Monitor($request, $init); 
    48         $result = $ids->run(); 
     48        $result = $ids->run();         
    4949 
    50         if (!$result->isEmpty()) { 
     50        list ($iImpactLog, $iImpactBlock) = bx_sys_security_get_impact_threshold ();         
     51 
     52        if (!$result->isEmpty() && $result->getImpact() >= $iImpactLog) { 
     53             
    5154            require_once( BX_DIRECTORY_PATH_CLASSES . "BxDolService.php" ); 
    5255            require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
     
    5760            $s .=  "\nHTTP_X_FORWARDED_FOR: " . $_SERVER['HTTP_X_FORWARDED_FOR']; 
    5861            $s .=  "\nHTTP_CLIENT_IP: " . $_SERVER['HTTP_CLIENT_IP']; 
    59             sendMail($GLOBALS['site']['bugReportMail'], $GLOBALS['site']['url'] . ' -  possible attack!', $s, 0, array(), 'text'); 
    60             echo 'Possible attack!!! All data has been collected and sent to the site owner for analysis.'; 
    61             exit; 
     62            $s .=  "\nSCRIPT_FILENAME: " . $_SERVER['SCRIPT_FILENAME']; 
     63            $s .=  "\nQUERY_STRING: " . $_SERVER['QUERY_STRING']; 
     64            $s .=  "\nREQUEST_URI: " . $_SERVER['REQUEST_URI']; 
     65            $s .=  "\nQUERY_STRING: " . $_SERVER['QUERY_STRING']; 
     66            $s .=  "\nSCRIPT_NAME: " . $_SERVER['SCRIPT_NAME']; 
     67            $s .=  "\nPHP_SELF: " . $_SERVER['PHP_SELF'];             
     68            if ($result->getImpact() >= $iImpactBlock) { 
     69                sendMail($GLOBALS['site']['bugReportMail'], $GLOBALS['site']['url'] . ' -  security attack was stopped!', $s, 0, array(), 'text'); 
     70                echo 'Possible security attack!!! All data has been collected and sent to the site owner for analysis.'; 
     71                exit; 
     72            } else { 
     73                sendMail($GLOBALS['site']['bugReportMail'], $GLOBALS['site']['url'] . ' -  possible security attack!', $s, 0, array(), 'text'); 
     74            } 
    6275        } 
    6376    } else { 
     
    7992        if (!file_exists($sCacheFile)) { 
    8093            require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' ); 
    81             $mixedVar = $GLOBALS['MySQL']->fromCache ("sys_{$sType}_fields", 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_html_fields' LIMIT 1"); 
     94            $mixedVar = $GLOBALS['MySQL']->fromCache ("sys_{$sType}_fields", 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_{$sType}_fields' LIMIT 1"); 
    8295        } else { 
    8396            include $sCacheFile; 
     
    92105    } 
    93106 
     107    function bx_sys_security_get_impact_threshold () { 
     108        $sCacheFile = BX_DIRECTORY_PATH_CACHE . "sys_options.php"; 
     109        if (!file_exists($sCacheFile)) { 
     110            require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' ); 
     111            return array (getParam('sys_security_impact_threshold_log'), getParam('sys_security_impact_threshold_block')); 
     112        } else { 
     113            include $sCacheFile; 
     114        } 
     115        return array ($mixedData['sys_security_impact_threshold_log'], $mixedData['sys_security_impact_threshold_block']); 
     116    } 
     117 
    94118?> 
  • trunk/install/sql/v70.sql

    r13257 r13259  
    11561156INSERT INTO `sys_options` VALUES('categ_show_limit', '50', 27, 'Number of categories to show limit', 'digit', '', '', 2, ''); 
    11571157INSERT INTO `sys_options` VALUES('categ_show_columns', '5', 27, 'Number of columns to show categories', 'digit', '', '', 3, ''); 
     1158INSERT INTO `sys_options` VALUES('sys_security_impact_threshold_log', '9', 3, 'Total security impact threshold to send report', 'digit', '', '', 0, ''); 
     1159INSERT INTO `sys_options` VALUES('sys_security_impact_threshold_block', '27', 3, 'Total security impact threshold to send report and block aggressor', 'digit', '', '', 0, ''); 
    11581160 
    11591161-- -------------------------------------------------------- 
  • trunk/modules/boonex/open_social/integration/html/index.php

    r11396 r13259  
    1818 * 
    1919 */ 
     20 
     21define('BX_SECURITY_EXCEPTIONS', true); 
     22$aBxSecurityExceptions = array( 
     23    'POST.request', 
     24    'GET.request', 
     25    'REQUEST.request', 
     26); 
     27 
    2028$aPathInfo = pathinfo(__FILE__); 
    2129require_once ($aPathInfo['dirname'] . '/../../../../../inc/header.inc.php'); 
  • trunk/modules/boonex/open_social/shindig/php/index.php

    r11396 r13259  
    1818 * under the License. 
    1919 */ 
     20 
     21define('BX_SECURITY_EXCEPTIONS', true); 
     22$aBxSecurityExceptions = array( 
     23    'POST.request', 
     24    'GET.request', 
     25    'REQUEST.request', 
     26); 
    2027 
    2128// 'A' configuration 
Note: See TracChangeset for help on using the changeset viewer.