Allows to login with any password in some scenarios with LDAP


One user has reported, that when setup with Apple Open Directory (LDAP) Openfire allows logging in with any password. Another user reports same issue with OpenLDAP with certain conditions:

The setup:

Openfire 4.2.3 (The corresponding code was not changed in the master)
OpenLDAP (Anonymous Login enabled)

Steps to Reproduce:

  1. set up OpenLDAP server (with users and user groups and a login for the Openfire server). Allow Anonymous Login.

  2. activate StartTLS with an SSL certificate that does not match the hostname.

  3. set up Openfire with LDAP connection to OpenLDAP (activate StartTLS).

What happens:

  1. certificate validation fails at ( hostname of the server ‘XXXXXXXXXXXX’ does not match the hostname in the server’s certificate.)

  2. the username and password are not set at

  3. the exception is intercepted and logged at

  4. should actually throw an exception, but it doesn’t, since the context is valid for anonymous login. This will cause the user to be logged in.

Possible solution:

  1. do not catch

  2. do not catch

  3. do not catch

For our concrete problem it helped to disable the anonymous login in the OpenLDAP server (incorrectly configured). In addition, the certificate for the LDAP server had to contain the common name and the alternative name of the host name of the server.
However, it should not be possible for such a misconfiguration to cause the fallback to make it possible to log in with any password.
With ApacheDirectoryServer we could not reproduce the problem. We think it is because OpenLDAP does not require you to set “env.put(Context.SECURITY_AUTHENTICATION, “none”);” for the anonymous login, ApacheDirectoryServer does.



OpenLDAP, Apple Open Directory


Greg Thomas
April 26, 2019, 10:30 AM

Fixed in 


(finger trouble meant this ticket wasn't referenced in the commit comment)



Greg Thomas