Skip to content

All LDAP Bind errors are treated as a username/password problem #3777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 7 tasks
MCF opened this issue Apr 9, 2018 · 2 comments
Open
2 of 7 tasks

All LDAP Bind errors are treated as a username/password problem #3777

MCF opened this issue Apr 9, 2018 · 2 comments
Labels
topic/authentication type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@MCF
Copy link
Contributor

MCF commented Apr 9, 2018

  • Gitea version (or commit ref): 1.3.2
  • Git version: 2.15.1
  • Operating system: Windows Server 2012
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

If LDAP bind fails for reasons other than the wrong username or password the user interface will still return that as the error. For example Active Directory servers are often configured with password retry limits, if they are exceeded the LDAP directory will return an LDAP constraint violation (LDAP Result Code 19) - this error ends up in the server log. No amount of retrying the password will succeed yet the user interface will return the Incorrect username or password error message.

I've had a look at the code around this and improving the error message to the user is not straightforward, and I wouldn't imagine this is a high priority. But I thought it might help others who run into the same problem to at least document it in an issue.

@lafriks lafriks added type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/enhancement An improvement of existing functionality labels Apr 9, 2018
@lafriks
Copy link
Member

lafriks commented Apr 9, 2018

It has to be very careful to not disclose too much information. It's always balance security vs usability.

@MCF
Copy link
Contributor Author

MCF commented Apr 9, 2018

Yes, but I would think you could split it into a couple of buckets:

  1. bad username/password
  2. account may have a problem (password expired, locked due to too many retries).
  3. error connecting to ldap/authentication server

The 2nd and 3rd errors could have something in the error message like "please contact your sys admin" to push people in the right direction. I guess they will end up doing that anyway after retrying their username/password a number of times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/authentication type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

4 participants