-
Notifications
You must be signed in to change notification settings - Fork 990
Description
Hi!
I noticed unexpected behavior while using your OpenLDAP image..
After changing the passwords of cn=admin,dc=example,dc=org
you can still login using the old password with full rights. The reason is that this image defines RootDN
and RootPW
in DN: olcDatabase={1}hdb,cn=config
as cn=admin,dc=example,dc=org
. This is a separate login.
steps to reproduce
Start the stuff
me@VirtualBox:~/test/docker-openldap/example$ docker-compose up
Login via PHPLDapAdmin
username: cn=admin,dc=example,dc=org
password: admin
Change the password of cn=admin,dc=example,dc=org
to example
Use hash {SSHA}bbbIClpMGqvOpa5Yc9x+VS/9PN1czs1B
Or create a new SSHA hash here: http://projects.marsching.org/weave4j/util/genpassword.php (not for production)
Save.
Login again with cn=admin,dc=example,dc=org
with the old password admin
Expected behavior:
Login fails
Observed behavior
Login succeeds, given full root access.
(Note, you can also login with cn=admin,dc=example,dc=org
using the new password example
. You're now logged in as a user and the ACL as defined in 02-security.ldif will give you full access)
Reason why
In DN: olcDatabase={1}hdb,cn=config
database the RootDN is defined as cn=admin,dc=example,dc=org
with the initial password set in RootPW
. This is a real root-user with full access that bypasses all ACL. This password is not changed when you change the password of cn=admin,dc=example,dc=org
.
Note, to login to the cn=config
database you need the config credentials. By default in this image:
Username: cn=admin,cn=config
Password: config
Impact
If people start the image with the default password and change the password of cn=admin,dc=example,dc=org
to something more secure later then they're gonna have a bad time.
Suggested fix
I really think there's no need for the user cn=admin,dc=example,dc=org
with the ACL giving all permissions. Just simply rely on the RootDN
in DN: olcDatabase={1}hdb,cn=config
and explain people how cn=config
works.