Skip to content

Commit 2c562da

Browse files
authored
Security Update: Blank password bypass in LDAP
1 parent 43f1b74 commit 2c562da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

auth.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ func AuthUserPass(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, err
1818
if _, ok := config.Users[conn.User()]; ! ok {
1919
return nil, fmt.Errorf("User Doesn't Exist in Config")
2020
}
21+
22+
if string(password) == "" {
23+
// Blank password isn't handled properly by LDAP library, fail here.
24+
return nil, fmt.Errorf("Blank Password Not Allowed")
25+
}
2126

2227
if config.Global.AuthType == "ad" {
2328
l, err := ldap.Dial("tcp", config.Global.LDAP_Server)

0 commit comments

Comments
 (0)