Skip to content

Commit bd47f29

Browse files
committed
request #24149: Indirect LDAP injection via the ldap_id attribute of a user
A taint annotation has been added to hightlight the issue. A more global work on this topic will be done in independant contributions. Change-Id: I969d0ba6d2ff85b418bcaf728f49afc78dd49571
1 parent c30d68c commit bd47f29

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

plugins/ldap/include/LDAP_DirectorySynchronization.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function syncAll()
7676

7777
public function ldapSync($row, $users_are_suspendable = true)
7878
{
79-
$ldap_query = $this->ldap->getLDAPParam('eduid') . '=' . $row['ldap_id'];
79+
$ldap_query = $this->ldap->getLDAPParam('eduid') . '=' . ldap_escape($row['ldap_id'], '', LDAP_ESCAPE_FILTER);
8080
$userSync = $this->getLdapUserSync();
8181
$attributes = $userSync->getSyncAttributes($this->ldap);
8282

src/common/DB/Compat/Legacy2018/LegacyDataAccessInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public function fetch($result);
177177
* @param type $result
178178
*
179179
* @return type
180+
* @psalm-taint-source ldap
180181
*/
181182
public function fetchArray($result);
182183

0 commit comments

Comments
 (0)