Skip to content

Commit

Permalink
防止LDAP注入
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyber0xFE committed Dec 8, 2024
1 parent 36e7e12 commit ddcf5a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ldap/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func searchRequest(username string) (userInfo *ldap.Entry, err error) {
0,
0,
false,
fmt.Sprintf("(%v=%v)", viper.GetString("settings.ldap.userField"), username),
fmt.Sprintf("(%v=%v)", viper.GetString("settings.ldap.userField"), ldap.EscapeFilter(username)),
ldapFieldsFilter,
nil)

Expand Down

0 comments on commit ddcf5a6

Please sign in to comment.