Skip to content

Commit

Permalink
Security Update: Blank password bypass in LDAP
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacarpet committed Oct 10, 2017
1 parent 43f1b74 commit 2c562da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ func AuthUserPass(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, err
if _, ok := config.Users[conn.User()]; ! ok {
return nil, fmt.Errorf("User Doesn't Exist in Config")
}

if string(password) == "" {
// Blank password isn't handled properly by LDAP library, fail here.
return nil, fmt.Errorf("Blank Password Not Allowed")
}

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

0 comments on commit 2c562da

Please sign in to comment.