Skip to content

Commit

Permalink
Fix LDAP vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Nov 2, 2021
1 parent 2b9ae2e commit f1524d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (s *server) authAndCreateUserLdap(UserName string, UserPassword string) (*d

searchRequest := ldap.NewSearchRequest(viper.GetString("auth.ldap.basedn"),
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
fmt.Sprintf(viper.GetString("auth.ldap.filter"), UserName),
fmt.Sprintf(viper.GetString("auth.ldap.filter"), ldap.EscapeFilter(UserName)),
[]string{"dn", viper.GetString("auth.ldap.mail_attr"), viper.GetString("auth.ldap.cn_attr")},
nil,
)
Expand Down

0 comments on commit f1524d0

Please sign in to comment.