CVE-2015-10106 (PHP, published 2023-05-28T13:15Z)
Description: value: ** 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.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-89 \u2014 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
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.
Repository: https://github.com/mback2k/mh_httpbl
Files changed:
mod1/index.php
Commit message: 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.

Vulnerable code:
					$where = "block_ip = '". t3lib_div::_GP('block_ip') ."'";
					$order = t3lib_div::_GP('sort').' '.strtoupper(t3lib_div::_GP('order'));
					$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'))));
					$order = t3lib_div::_GP('sort').' '.strtoupper(t3lib_div::_GP('order'));
					$order = t3lib_div::_GP('sort').' '.strtoupper(t3lib_div::_GP('order'));

Fixed code:
					$where = 'block_ip = '. $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_div::_GP('block_ip'), 'tx_mhhttpbl_blocklog');
					$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;
					$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));
					$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;
					$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;