On any Joomla site just make a get Request via web browser:
https://www.joomla.org/index.php/component/users?Itemid[]
Warning
Error loading module Unknown column 'Array' in 'where clause'
We would not have to fix anything if the getInt method of our Input class just returns an integer value as described in the docblock https://github.com/joomla/joomla-cms/blob/staging/libraries/vendor/joomla/input/src/Input.php#L28
Unfortunately, it also returns array of integer in case data from request is an array and it causes this kind of error.
Changing default input filter behavior, I think, is out of the question at this point.
there is a discussion about if this error lead to sql injection. As a security engineer i know that it can't happens because in source code it used prepared statements. But because the error include an sql phrase people think about the sql vulnerability and the are trying to exploit it.
@HLeithner @SniperSister Anything we can do here or should it be closed?
@brianteeman it's not a risk from an SQLi perspective, as the string concatenation in our statements converts a PHP array into the string "Array". This will cause an error message but not allow any further query manipulation.
So it's more a design issue: our Input class (and also the filter classes) by default return arrays as soon as the user input is an array. So, if user supplied input is passed as an array in places where the developer doesn't expect that to happen, we see exactly this type of errors.
A proper fix would be to make the array retrieval optional, so developer have to specifically enable it - however that's a huge b/c break and therefore a no-go at least for Joomla 3. For 4.x it would require a rather massive change across the codebase as we would have to check and potentially adjust every jinput call.
The alternatives:
Thanks @SniperSister I will leave it up to maintainers to make a decision
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-31 18:45:06 |
Closed_By | ⇒ | HLeithner |
@roussis could you please test the mentioned pr?
It is the same result.
https://www.joomla.org/index.php/component/users?Itemid%5B%5D
If it is decided to fix query manipulations like this, there will be A LOT of fixing to do.