Skip to content

Commit 1b5aeea

Browse files
andreschweigertfwolf-ilias
authored andcommitted
[PATCH] fix(soap): fix SQL injection in searchUser via query_operator
searchUser() validated query_operator with || instead of &&, making the condition always true. raiseError() was also called without return, so execution continued regardless. Combined, this allowed any authenticated user with read_users permission to inject arbitrary SQL via the query_operator parameter (full user table disclosure, credential extraction via boolean blind SQLi). Fix: change || to && and add return before raiseError(). Affected: components/ILIAS/soap/classes/class.ilSoapUserAdministration.php Signed-off-by: Releasemanager <webmaster@ilias.de>
1 parent 1843d90 commit 1b5aeea

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

components/ILIAS/soap/classes/class.ilSoapUserAdministration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,8 @@ public function searchUser(
684684
return $this->raiseError('At least one keyvalue is needed', 'Client');
685685
}
686686

687-
if (strcasecmp($query_operator, "and") !== 0 || strcasecmp($query_operator, "or") !== 0) {
688-
$this->raiseError('Query operator must be either \'and\' or \'or\'', 'Client');
687+
if (strcasecmp($query_operator, "and") !== 0 && strcasecmp($query_operator, "or") !== 0) {
688+
return $this->raiseError('Query operator must be either \'and\' or \'or\'', 'Client');
689689
}
690690

691691
$query = $this->buildSearchQuery($a_keyfields, $query_operator, $a_keyvalues);

0 commit comments

Comments
 (0)