Changeset 13117
- Timestamp:
- 10/29/09 23:28:44 (3 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
administration/banners.php (modified) (1 diff)
-
administration/basic_settings.php (modified) (1 diff)
-
administration/css_file.php (modified) (1 diff)
-
administration/lang_file.php (modified) (1 diff)
-
administration/notifies.php (modified) (1 diff)
-
administration/pageBuilder.php (modified) (1 diff)
-
inc/classes/BxDolInstaller.php (modified) (2 diffs)
-
inc/security.inc.php (modified) (2 diffs)
-
install/sql/v70.sql (modified) (1 diff)
-
join.php (modified) (1 diff)
-
modules/boonex/map_profiles/install/installer.php (modified) (1 diff)
-
modules/boonex/open_social/os.php (modified) (1 diff)
-
pedit.php (modified) (1 diff)
-
plugins/phpids/IDS/Config/Config.ini (modified) (1 diff)
-
plugins/phpids/IDS/default_filter.xml (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/banners.php
r12933 r13117 18 18 * see license.txt file; if not, write to marketing@boonex.com 19 19 ***************************************************************************/ 20 21 define('BX_SECURITY_EXCEPTIONS', true); 22 $aBxSecurityExceptions = array( 23 'POST.Text', 24 'REQUEST.Text', 25 ); 20 26 21 27 require_once( '../inc/header.inc.php' ); -
trunk/administration/basic_settings.php
r12257 r13117 18 18 * see license.txt file; if not, write to marketing@boonex.com 19 19 ***************************************************************************/ 20 21 define('BX_SECURITY_EXCEPTIONS', true); 22 $aBxSecurityExceptions = array( 23 'POST.content_text', 24 'REQUEST.content_text', 25 ); 20 26 21 27 require_once( '../inc/header.inc.php' ); -
trunk/administration/css_file.php
r11473 r13117 18 18 * see license.txt file; if not, write to marketing@boonex.com 19 19 ***************************************************************************/ 20 21 define('BX_SECURITY_EXCEPTIONS', true); 22 $aBxSecurityExceptions = array( 23 'POST.content', 24 'REQUEST.content', 25 ); 20 26 21 27 require_once( '../inc/header.inc.php' ); -
trunk/administration/lang_file.php
r12534 r13117 19 19 ***************************************************************************/ 20 20 21 define ('BX_SECURITY_EXCEPTIONS', true); 22 $aBxSecurityExceptions = array (); 23 for ($i=1; $i<255 ; ++$i) { 24 $aBxSecurityExceptions[] = 'POST.string_for_'.$i; 25 $aBxSecurityExceptions[] = 'REQUEST.string_for_'.$i; 26 } 27 21 28 require_once( '../inc/header.inc.php' ); 22 29 require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); -
trunk/administration/notifies.php
r11762 r13117 18 18 * see license.txt file; if not, write to marketing@boonex.com 19 19 ***************************************************************************/ 20 21 define('BX_SECURITY_EXCEPTIONS', true); 22 $aBxSecurityExceptions = array( 23 'POST.body', 24 'REQUEST.body', 25 ); 20 26 21 27 require_once( '../inc/header.inc.php' ); -
trunk/administration/pageBuilder.php
r12554 r13117 20 20 ***************************************************************************/ 21 21 22 define('BX_SECURITY_EXCEPTIONS', true); 23 $aBxSecurityExceptions = array( 24 'POST.Content', 25 'REQUEST.Content', 26 ); 27 22 28 require_once( '../inc/header.inc.php' ); 23 29 require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' ); -
trunk/inc/classes/BxDolInstaller.php
r13053 r13117 634 634 } 635 635 636 function _getLanguageHtmlFields () {637 $aRet = array ();638 $a = $GLOBALS['MySQL']->getAll ("SELECT `ID` FROM `sys_localization_languages`");639 foreach ($a as $r) {640 $aRet[] = 'POST.string_for_'.$r['ID'];641 $aRet[] = 'REQUEST.string_for_'.$r['ID'];642 }643 return $aRet;644 }645 646 636 function addHtmlFields ($a) { 647 $s = getParam('sys_html_fields'); 648 $this->_aConfig['home_uri']; 637 $this->_addFields ('html', $a); 638 } 639 640 function removeHtmlFields () { 641 $this->_removeFields('html'); 642 } 643 644 function addJsonFields ($a) { 645 $this->_addFields ('json', $a); 646 } 647 648 function removeJsonFields () { 649 $this->_removeFields('json'); 650 } 651 652 function addExceptionsFields ($a) { 653 $this->_addFields ('exceptions', $a); 654 } 655 656 function removeExceptionsFields () { 657 $this->_removeFields('exceptions'); 658 } 659 660 //--- Protected methods ---// 661 662 function _addFields ($sType, $a) { 663 switch ($sType) { 664 case 'html': 665 case 'json': 666 case 'exceptions': 667 break; 668 default: 669 return array(); 670 } 671 672 $s = getParam("sys_{$sType}_fields"); 649 673 if (!$s) { 650 $a = array ( 651 $this->_aConfig['home_uri'] => $a, 652 'system_email_templates' => $this->_getEmailTemplatesHtmlFields(), 653 'system_langs' => $this->_getLanguageHtmlFields(), 654 ); 674 $a = array ($this->_aConfig['home_uri'] => $a); 675 if ('exceptions' == $sType) { 676 $a['system_email_templates'] = $this->_getEmailTemplatesHtmlFields(); 677 } 655 678 } else { 656 679 $a = array_merge (unserialize($s), array ($this->_aConfig['home_uri'] => $a)); 680 if ('exceptions' == $sType) { 681 unset($a['system_email_templates']); 682 $a['system_email_templates'] = $this->_getEmailTemplatesHtmlFields(); 683 } 684 } 685 $s = serialize ($a); 686 setParam ("sys_{$sType}_fields", $s); 687 // recreate cache 688 $GLOBALS['MySQL']->cleanCache ("sys_{$sType}_fields"); 689 $GLOBALS['MySQL']->fromCache ("sys_{$sType}_fields", 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_{$sType}_fields' LIMIT 1"); 690 } 691 692 function _removeFields ($sType) { 693 switch ($sType) { 694 case 'html': 695 case 'json': 696 case 'exceptions': 697 break; 698 default: 699 return array(); 700 } 701 702 $s = getParam('sys_html_fields'); 703 if (!$s) { 704 return; 705 } 706 $a = unserialize($s); 707 unset ($a[$this->_aConfig['home_uri']]); 708 if ('exceptions' == $sType) { 657 709 unset($a['system_email_templates']); 658 unset($a['system_langs']);659 710 $a['system_email_templates'] = $this->_getEmailTemplatesHtmlFields(); 660 $a['system_langs'] = $this->_getLanguageHtmlFields();661 711 } 662 712 $s = serialize ($a); … … 666 716 $GLOBALS['MySQL']->fromCache ('sys_html_fields', 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_html_fields' LIMIT 1"); 667 717 } 668 669 function removeHtmlFields () { 670 $s = getParam('sys_html_fields'); 671 $this->_aConfig['home_uri']; 672 if (!$s) { 673 return; 674 } 675 $a = unserialize($s); 676 unset ($a[$this->_aConfig['home_uri']]); 677 unset($a['system_email_templates']); 678 unset($a['system_langs']); 679 $a['system_email_templates'] = $this->_getEmailTemplatesHtmlFields(); 680 $a['system_langs'] = $this->_getLanguageHtmlFields(); 681 $s = serialize ($a); 682 setParam ('sys_html_fields', $s); 683 // recreate cache 684 $GLOBALS['MySQL']->cleanCache ('sys_html_fields'); 685 $GLOBALS['MySQL']->fromCache ('sys_html_fields', 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_html_fields' LIMIT 1"); 686 } 687 688 //--- Protected methods ---// 718 689 719 function _updateLanguage($bInstall, $aLanguage, $iCategoryId = 0) { 690 720 if(empty($iCategoryId)) -
trunk/inc/security.inc.php
r13108 r13117 22 22 $init->config['General']['tmp_path'] = '../../../tmp/'; 23 23 $init->config['Caching']['path'] = '../../../tmp/default_filter.cache'; 24 $init->config['General']['html'] = bx_sys_security_get_html_fileds (); 24 25 26 if (defined('BX_SECURITY_JSON') && is_array($aBxSecurityJSON)) { 27 $init->config['General']['json'] = array_merge ($init->config['General']['json'], $aBxSecurityJSON); 28 } 29 $init->config['General']['json'] = array_merge($init->config['General']['json'], bx_sys_security_get_fields ('json')); 30 31 32 if (defined('BX_SECURITY_HTML') && is_array($aBxSecurityHTML)) { 33 $init->config['General']['html'] = array_merge ($init->config['General']['html'], $aBxSecurityHTML); 34 } 35 $init->config['General']['html'] = array_merge($init->config['General']['html'], bx_sys_security_get_fields ('html')); 36 37 38 if (defined('BX_SECURITY_EXCEPTIONS') && is_array($aBxSecurityExceptions)) { 39 $init->config['General']['exceptions'] = array_merge ($init->config['General']['exceptions'], $aBxSecurityExceptions); 40 } 41 $init->config['General']['exceptions'] = array_merge($init->config['General']['exceptions'], bx_sys_security_get_fields ('exceptions')); 42 25 43 26 44 $init->config['General']['HTML_Purifier_Path'] = BX_DIRECTORY_PATH_PLUGINS . 'htmlpurifier/HTMLPurifier.standalone.php'; … … 47 65 } 48 66 49 function bx_sys_security_get_html_fileds () { 50 $sCacheFile = BX_DIRECTORY_PATH_CACHE . 'db_sys_html_fields.php'; 67 68 function bx_sys_security_get_fields ($sType) { 69 switch ($sType) { 70 case 'html': 71 case 'json': 72 case 'exceptions': 73 break; 74 default: 75 return array(); 76 } 77 78 $sCacheFile = BX_DIRECTORY_PATH_CACHE . "db_sys_{$sType}_fields.php"; 51 79 if (!file_exists($sCacheFile)) { 52 80 require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' ); 53 $mixedVar = $GLOBALS['MySQL']->fromCache ( 'sys_html_fields', 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_html_fields' LIMIT 1");81 $mixedVar = $GLOBALS['MySQL']->fromCache ("sys_{$sType}_fields", 'getOne', "SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_html_fields' LIMIT 1"); 54 82 } else { 55 83 include $sCacheFile; -
trunk/install/sql/v70.sql
r13078 r13117 1082 1082 INSERT INTO `sys_options` VALUES('license_expiration', '', 0, 'Dolphin License Expiration', 'digit', '', '', 0, ''); 1083 1083 INSERT INTO `sys_options` VALUES('license_checksum', '', 0, 'Dolphin License Checksum', 'digit', '', '', 0, ''); 1084 INSERT INTO `sys_options` VALUES('sys_html_fields', 'a:1:{s:6:"system";a:18:{i:0;s:20:"POST.DescriptionMe.0";i:1;s:23:"REQUEST.DescriptionMe.0";i:2;s:20:"POST.DescriptionMe.1";i:3;s:23:"REQUEST.DescriptionMe.1";i:4;s:12:"POST.message";i:5;s:15:"REQUEST.message";i:6;s:9:"POST.body";i:7;s:12:"REQUEST.body";i:8;s:9:"POST.Text";i:9;s:12:"REQUEST.Text";i:10;s:12:"POST.Content";i:11;s:15:"REQUEST.Content";i:12;s:17:"POST.content_text";i:13;s:20:"REQUEST.content_text";i:14;s:12:"POST.content";i:15;s:15:"REQUEST.content";i:16;s:12:"POST.CmtText";i:17;s:15:"REQUEST.CmtText";}}', 0, 'HTML fields', 'text', '', '', 0, ''); 1084 INSERT INTO `sys_options` VALUES('sys_html_fields', 'a:1:{s:6:"system";a:4:{i:0;s:12:"POST.message";i:1;s:15:"REQUEST.message";i:2;s:12:"POST.CmtText";i:3;s:15:"REQUEST.CmtText";}}', 0, 'HTML fields', 'text', '', '', 0, ''); 1085 INSERT INTO `sys_options` VALUES('sys_json_fields', '', 0, 'JSON fields', 'text', '', '', 0, ''); 1086 INSERT INTO `sys_options` VALUES('sys_exceptions_fields', '', 0, 'Exceptions fields', 'text', '', '', 0, ''); 1085 1087 INSERT INTO `sys_options` VALUES('enable_dolphin_footer', 'on', 0, 'enable boonex footers', 'checkbox', '', '', NULL, ''); 1086 1088 INSERT INTO `sys_options` VALUES('enable_modrewrite', 'on', 26, 'Enable friendly profile permalinks', 'checkbox', '', '', 1, ''); -
trunk/join.php
r13020 r13117 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ 22 23 define('BX_SECURITY_HTML', true); 24 $aBxSecurityHTML = array( 25 'POST.DescriptionMe.0', 26 'REQUEST.DescriptionMe.0', 27 'POST.DescriptionMe.1', 28 'REQUEST.DescriptionMe.1', 29 ); 22 30 23 31 define('BX_INDEX_PAGE', 1); -
trunk/modules/boonex/map_profiles/install/installer.php
r9441 r13117 27 27 parent::BxDolInstaller($aConfig); 28 28 } 29 30 function install($aParams) { 31 32 $aResult = parent::install($aParams); 33 34 $this->addExceptionsFields (array ('POST.bx_map_key', 'REQUEST.bx_map_key')); 35 36 return $aResult; 37 } 38 39 function uninstall() { 40 41 $ret = parent::uninstall(array()); 42 43 $this->removeExceptionsFields (); 44 45 return $ret; 46 } 29 47 } 30 48 ?> -
trunk/modules/boonex/open_social/os.php
r10962 r13117 18 18 * see license.txt file; if not, write to marketing@boonex.com 19 19 ***************************************************************************/ 20 21 define('BX_SECURITY_EXCEPTIONS', true); 22 $aBxSecurityExceptions = array( 23 'POST.request', 24 'GET.request', 25 'REQUEST.request', 26 ); 20 27 21 28 require_once( '../../../inc/header.inc.php' ); -
trunk/pedit.php
r12050 r13117 21 21 ***************************************************************************/ 22 22 23 define('BX_SECURITY_HTML', true); 24 $aBxSecurityHTML = array( 25 'POST.DescriptionMe.0', 26 'REQUEST.DescriptionMe.0', 27 'POST.DescriptionMe.1', 28 'REQUEST.DescriptionMe.1', 29 ); 30 23 31 require_once( './inc/header.inc.php' ); 24 32 require_once( BX_DIRECTORY_PATH_INC . 'admin.inc.php' ); -
trunk/plugins/phpids/IDS/Config/Config.ini
r13109 r13117 35 35 exceptions[] = REQUEST.__utmz 36 36 exceptions[] = REQUEST.__utmc 37 exceptions[] = REQUEST.__gads 37 38 exceptions[] = COOKIE.__utmz 38 exceptions[] = COOKIE.__utmc 39 exceptions[] = REQUEST.bx_map_key 40 exceptions[] = POST.bx_map_key 39 exceptions[] = COOKIE.__utmc 40 exceptions[] = COOKIE.__gads 41 41 42 42 ; PHPIDS should run with PHP 5.1.2 but this is untested - set -
trunk/plugins/phpids/IDS/default_filter.xml
r13007 r13117 61 61 </filter> 62 62 <filter> 63 <id>6</id>64 <rule><![CDATA[(?:with\s*\(\s*.+\s*\)\s*\w+\s*\()|(?:(?:do|while|for)\s*\([^)]*\)\s*\{)|(?:\/[\w\s]*\[\W*\w)]]></rule>65 <description>Detects self contained xss via with(), common loops and regex to string conversion</description>66 <tags>67 <tag>xss</tag>68 <tag>csrf</tag>69 </tags>70 <impact>5</impact>71 </filter>72 <filter>73 63 <id>7</id> 74 64 <rule><![CDATA[(?:\d\s*[|&]{2}\s*\w)|(?:[=(].+\?.+:)|(?:with\([^)]*\)\))|(?:\.\s*source\W)|(?:\?[^:=]+:[^;]+(;|$))]]></rule> … … 424 414 </filter> 425 415 <filter> 426 <id>39</id>427 <rule><![CDATA[(?:\\x[01fe][\db-ce-f])|(?:%[01fe][\db-ce-f])|(?:&#[01fe][\db-ce-f])|(?:\\[01fe][\db-ce-f])|(?:&#x[01fe][\db-ce-f])]]></rule>428 <description>Detects nullbytes and other dangerous characters</description>429 <tags>430 <tag>id</tag>431 <tag>rfe</tag>432 <tag>xss</tag>433 </tags>434 <impact>5</impact>435 </filter>436 <filter>437 416 <id>40</id> 438 417 <rule><![CDATA[(?:"\s*(?:#|--|{))|(?:\/\*!\s?\d+)|(?:ch(?:a)?r\s*\(\s*\d)|(?:(?:(n?and|x?or|not)\s+|\|\||\&\&)\s*\w+\()]]></rule> … … 477 456 </tags> 478 457 <impact>6</impact> 479 </filter> 480 <filter> 481 <id>44</id> 482 <rule><![CDATA[(?:\d"\s+"\s+\d)|(?:^admin\s*"|(\/\*)+"+\s?(?:--|#|\/\*|{)?)|(?:"\s*or[\w\s-]+\s*[+<>=(),-]\s*[\d"])|(?:"\s*[^\w\s]?=\s*")|(?:"\W*[+=]+\W*")|(?:"\s*[!=|][\d\s!=+-]+.*["(].*$)|(?:"\s*[!=|][\d\s!=]+.*\d+$)|(?:"\s*like\W+[\w"(])|(?:\sis\s*0\W)|(?:where\s[\s\w\.,-]+\s=)|(?:"[<>~]+")]]></rule> 483 <description>Detects basic SQL authentication bypass attempts 1/3</description> 484 <tags> 485 <tag>sqli</tag> 486 <tag>id</tag> 487 <tag>lfi</tag> 488 </tags> 489 <impact>7</impact> 490 </filter> 491 <filter> 492 <id>45</id> 493 <rule><![CDATA[(?:union\s*(?:all|distinct|[(!@]*)?\s*[([]\s*select)|(?:\w+\s+like\s+\")|(?:like\s*"\%)|(?:"\s*like\W*["\d])|(?:"\s*(?:n?and|x?or|not |\|\||\&\&)\s+[\s\w]+=\s*\w+\s*having)|(?:"\s*\*\s*\w+\W+")|(?:"\s*[^?\w\s=.,;)(]+\s*[(@]*\s*\w+\W+\w)|(?:select\s*[\[\]()\s\w\.,-]+from)]]></rule> 494 <description>Detects basic SQL authentication bypass attempts 2/3</description> 495 <tags> 496 <tag>sqli</tag> 497 <tag>id</tag> 498 <tag>lfi</tag> 499 </tags> 500 <impact>7</impact> 501 </filter> 502 <filter> 503 <id>46</id> 504 <rule><![CDATA[(?:(?:n?and|x?or|not |\|\||\&\&)\s+[\s\w+]+(?:regexp\s*\(|sounds\s+like\s*"|[=\d]+x))|("\s*\d\s*(?:--|#))|(?:"[%&<>^=]+\d\s*(=|or))|(?:"\W+[\w+-]+\s*=\s*\d\W+")|(?:"\s*is\s*\d.+"?\w)|(?:"\|?[\w-]{3,}[^\w\s.,]+")|(?:"\s*is\s*[\d.]+\s*\W.*")]]></rule> 505 <description>Detects basic SQL authentication bypass attempts 3/3</description> 506 <tags> 507 <tag>sqli</tag> 508 <tag>id</tag> 509 <tag>lfi</tag> 510 </tags> 511 <impact>7</impact> 512 </filter> 458 </filter> 513 459 <filter> 514 460 <id>47</id> … … 690 636 <impact>5</impact> 691 637 </filter> 638 <!-- 692 639 <filter> 693 640 <id>67</id> … … 703 650 <impact>7</impact> 704 651 </filter> 652 --> 705 653 <filter> 706 654 <id>68</id>
Note: See TracChangeset
for help on using the changeset viewer.