]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
SECURITY FIX bug 54901: If you were using LDAP authentication it would let you log...
authorjustdave%syndicomm.com <>
Sun, 9 Dec 2001 23:56:23 +0000 (23:56 +0000)
committerjustdave%syndicomm.com <>
Sun, 9 Dec 2001 23:56:23 +0000 (23:56 +0000)
blank.
Patch by David Crowe <crow@waveset.com>
r= jmrobins, justdave

CGI.pl

diff --git a/CGI.pl b/CGI.pl
index 5a2b5f7cec8bdf3a7c809e9c9fa041d72559cf11..e245c1db423db6dd25e52bbd502b28c6494bcf21 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -868,6 +868,21 @@ sub confirm_login {
          exit;
        }
 
+       # if no password was provided, then fail the authentication
+       # while it may be valid to not have an LDAP password, when you
+       # bind without a password (regardless of the binddn value), you
+       # will get an anonymous bind.  I do not know of a way to determine
+       # whether a bind is anonymous or not without making changes to the
+       # LDAP access control settings
+       if ( ! $::FORM{"LDAP_password"} ) {
+         print "Content-type: text/html\n\n";
+         PutHeader("Login Failed");
+         print "You did not provide a password.\n";
+         print "Please click <b>Back</b> and try again.\n";
+         PutFooter();
+         exit;
+       }
+
        # We've got our anonymous bind;  let's look up this user.
        my $dnEntry = $LDAPconn->search(Param("LDAPBaseDN"),"subtree","uid=".$::FORM{"LDAP_login"});
        if(!$dnEntry) {