LDAP login possible even though account doesn't match user filter
Nextcloud's LDAP login accepted any valid directory account, even ones excluded by the configured user filter, so users who should have been denied access could still sign in and get an account created. The account was hidden from the admin Users page but still usable.
- Disclosed after 2.4 years
We have set up a ldap user filter to match only those users in our ldap directory which should get access to nextcloud. User count shows correct number of users as expected and the filter correctly shows only the users we want in an ldapsearch.
The ldap directory contains a lot of other accounts which don't match that filter and which should not get access to nextcloud. However, now we found out that it is possible for any valid user account in the ldap directory to log into nextcloud. The account is set up and login is successful even through the account does not match the filter.
The account won't be listed on the Users page of an nextcloud admin user, thus from that view the account doesn't exist.
I have just tested it with 11.0.1 (centos7, installed from rpms) and I was able to log in with a test account which does not match the user filter...
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the login path validated credentials against LDAP without re-applying the configured user filter, so the filter only affected user listing.
What the attacker needed
Nextcloud with LDAP authentication; a valid directory account outside the filter
How it was found
- Configure Nextcloud with an LDAP user filter that excludes some directory accounts.
- Confirm the filter works in a direct ldapsearch and that the user count is correct.
- Attempt to log in with a directory account that does not match the filter.
- Observe that the login succeeds and an account is created.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
An administrator set a filter so only certain directory accounts should be allowed. The bug meant accounts outside the filter could still log in with a valid directory password.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.