Skip to content

Commit 42be548

Browse files
authored
EscapeFilter the group dn membership (#20200) (#20254)
Backport #20200 The uid provided to the group filter must be properly escaped using the provided ldap.EscapeFilter function. Fix #20181 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 76ba23a commit 42be548

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/auth/source/ldap/source_search.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func checkRestricted(l *ldap.Conn, ls *Source, userDN string) bool {
199199
// List all group memberships of a user
200200
func (ls *Source) listLdapGroupMemberships(l *ldap.Conn, uid string) []string {
201201
var ldapGroups []string
202-
groupFilter := fmt.Sprintf("(%s=%s)", ls.GroupMemberUID, uid)
202+
groupFilter := fmt.Sprintf("(%s=%s)", ls.GroupMemberUID, ldap.EscapeFilter(uid))
203203
result, err := l.Search(ldap.NewSearchRequest(
204204
ls.GroupDN,
205205
ldap.ScopeWholeSubtree,

0 commit comments

Comments
 (0)