CVE-2015-10106 (published 2023-05-28T13:15Z)

** UNSUPPORTED WHEN ASSIGNED ** A vulnerability classified as critical was found in mback2k mh_httpbl Extension up to 1.1.7 on TYPO3. This vulnerability affects the function moduleContent of the file mod1/index.php. The manipulation leads to sql injection. The attack can be initiated remotely. Upgrading to version 1.1.8 is able to address this issue. The patch is identified as 429f50f4e4795b20dae06735b41fb94f010722bf. It is recommended to upgrade the affected component. VDB-230086 is the identifier assigned to this vulnerability. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.

CVSS v3 base score: 8.8, HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-89
cwe_name: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
description: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
extended_description: 
            
            
         
         

Fix information:
repo_url: https://github.com/mback2k/mh_httpbl
commit_details: repo_url: https://github.com/mback2k/mh_httpbl
author: Marc Hoersken
author_date: 2015-12-15 15:54:19+01:00
msg: Fix TYPO3-EXT-SA-2015-021: SQL Injection

Handle all user-input which is passed as WHERE or ORDER statement to
exec_SELECTquery using fullQuoteStr or explicit value checks.
repository: repo_url: https://github.com/mback2k/mh_httpbl
repo_name: mback2k/mh_httpbl
description: TYPO3 Extension: http:BL Blocking
repo_language: PHP
owner: mback2k
file_changes: filename: index.php
change_type: ModificationType.MODIFY
diff: @@ -204,12 +204,14 @@ class tx_mhhttpbl_module1 extends t3lib_SCbase {
 				';
 
 				if (t3lib_div::_GP('block_ip')) {
-					$where = "block_ip = '". t3lib_div::_GP('block_ip') ."'";
+					$where = 'block_ip = '. $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_div::_GP('block_ip'), 'tx_mhhttpbl_blocklog');
 				} else {
 					$where = '';
 				}
 				if (t3lib_div::_GP('sort') && t3lib_div::_GP('order')) {
-					$order = t3lib_div::_GP('sort').' '.strtoupper(t3lib_div::_GP('order'));
+					$sort_param = in_array(t3lib_div::_GP('sort'), array('tstamp', 'block_ip', 'block_type', 'block_score')) ? t3lib_div::_GP('sort') : 'tstamp';
+					$order_param = strtoupper(t3lib_div::_GP('order')) == 'ASC' ? 'ASC' : 'DESC';
+					$order = $sort_param.' '.$order_param;
 				} else {
 					$order = 'tstamp DESC';
 				}
@@ -240,7 +242,8 @@ class tx_mhhttpbl_module1 extends t3lib_SCbase {
 			break;
 			case 2:
 				if (t3lib_div::_GP('whitelist_add')) {
-					$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_mhhttpbl_whitelist', array('cruser_id'=>$BE_USER->user['uid'], 'crdate'=>time(), 'tstamp'=>time(), 'whitelist_ip'=>implode('.', t3lib_div::_GP('whitelist_ip'))));
+					$whitelist_ip = implode('.', array_map('intval', t3lib_div::_GP('whitelist_ip')));
+					$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_mhhttpbl_whitelist', array('cruser_id'=>$BE_USER->user['uid'], 'crdate'=>time(), 'tstamp'=>time(), 'whitelist_ip'=>$whitelist_ip));
 				} else if (t3lib_div::_GP('delete')) {
 					$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_mhhttpbl_whitelist', 'uid = '.intval(t3lib_div::_GP('delete')));
 				}
@@ -275,7 +278,9 @@ class tx_mhhttpbl_module1 extends t3lib_SCbase {
 				';
 
 				if (t3lib_div::_GP('sort') && t3lib_div::_GP('order')) {
-					$order = t3lib_div::_GP('sort').' '.strtoupper(t3lib_div::_GP('order'));
+					$sort_param = in_array(t3lib_div::_GP('sort'), array('tstamp', 'whitelist_ip')) ? t3lib_div::_GP('sort') : 'tstamp';
+					$order_param = strtoupper(t3lib_div::_GP('order')) == 'ASC' ? 'ASC' : 'DESC';
+					$order = $sort_param.' '.$order_param;
 				} else {
 					$order = 'tstamp DESC';
 				}
@@ -312,7 +317,9 @@ class tx_mhhttpbl_module1 extends t3lib_SCbase {
 				';
 
 				if (t3lib_div::_GP('sort') && t3lib_div::_GP('order')) {
-					$order = t3lib_div::_GP('sort').' '.strtoupper(t3lib_div::_GP('order'));
+					$sort_param = in_array(t3lib_div::_GP('sort'), array('block_ip', 'count')) ? t3lib_div::_GP('sort') : 'count';
+					$order_param = strtoupper(t3lib_div::_GP('order')) == 'ASC' ? 'ASC' : 'DESC';
+					$order = $sort_param.' '.$order_param;
 				} else {
 					$order = 'count DESC';
 				}

programming_language: PHP