mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #537] Security issue: Users can set their own arbitrary email addresses #196
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#196
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marlon0 on GitHub (Apr 8, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/537
Users are able to log in to lldap and change their own email address to anything.
This presents two security concerns:
1 - Since many applications use email address as a unique identifier, this can allow impersonating the application accounts of other users.
2 - An attacker could set their email to a target's address and then abuse the password reset feature to flood their inbox
The simplest, most secure fix is to add a config option to prevent users from modifying their own email address.
A more sophisticated fix would be to allow users to use a process similar to the password-reset flow to update their email, and to rate-limit the number of email updates which can be requested per-account.
@nitnelave commented on GitHub (Apr 10, 2023):
I'm a bit curious of your threat model: who are your users? Usually LLDAP is meant for a self-hosted case where users are lovingly hand-created by the admin, with a certain amount of trust. At least, that's been the working model so far, without issues. The security features that involve non-user behavior have always been taken seriously, but so far not so much the ones involving user behavior.
(There is one exception to that, something I want to address: since any user can change their email to the email of someone else, they can get admin access to a system that identifies by email. But I'll make emails unique to prevent this)
Notes for future implementers: the email-reset flow is probably too complex, and I don't want to implement rate-limits in LLDAP (you can always do that at the proxy level in front), so if we implement something, it'd be a setting to disable changing your email without admin rights.
@marlon0 commented on GitHub (Apr 11, 2023):
Yes, it's really the exception you mentioned that is the serious practical problem:
Currently a user can change their email address to the same address as an app's admin account. Then when they log in to the app using their own account, they'll be identified as the admin and have admin access.
You're right that requiring emails to be unique would solve this security issue, that's probably a better fix!
@nitnelave commented on GitHub (Apr 13, 2023):
(Note that it's a breaking change, so the server will not start if you have duplicate emails)
@hudac commented on GitHub (May 5, 2023):
I understand this issue has been closed already. But we ran into a similar, potential security issue.
Requiring emails to be unique within LLDAP definitely solves the issue here, but only if LLDAP is the only source for user authentication. But in our case, we are using ID federation (via Dex) which usually connects multiple ID providers. If I know the email of a user that uses Google for login, and I have an account on LLDAP, it is possible for me to "impersonate" the email of that user by just changing my email on LLDAP. And the solution we use relies on email for identifying users uniquely, regardless if they login via Google, or AD, or in this case LLDAP, same email means same user.
Is this already possible? Could not find anything in the config. That would at least reduce the risk above.
Another idea: Forced email verification (can be turned on/off via config).
This would apply to new users, as well as to changing the email of existing users. In order to become "active", means a login via LDAP can succeed, the new email must be always confirmed by the email owner first (a similar flow like the password reset). Otherwise, login should fail as if the credentials are wrong.
@nitnelave commented on GitHub (May 5, 2023):
It's not currently possible to lock a field. But you might be interested in this issue created today: https://github.com/lldap/lldap/issues/570
It'll have to wait until after #67 though, to benefit from the field-level control and modularity.
@kgfathur commented on GitHub (Jul 1, 2025):
Helo,
I am also concerned about users being able to change their emails arbitrarily, because when simply create user with email by admin, we expect the users cannot edit their own email address.
I am interested in how some fields can be made
Editable=False.The
User-defined attributescan be set Editable, why it is not applicable to email address too?@nitnelave commented on GitHub (Jul 1, 2025):
What exactly are you concerned about? Can you provide a problematic scenario?
@kgfathur commented on GitHub (Jul 1, 2025):
uid: user.name
email: user.name@example.com
IT Admin integrate Authentication for some Platform/Service (i.e: Gitlab, Jenkins, SonarQube, Nexus, etc), and as an alternatif to user name (uid), Admin also allow using email as authentication to login to particular services via LDAP. Even if the email is not used as id for authentication, it's still used as metadata by some services when integrated with LDAP.
User can login to some integrated Platform/Services using uid (username) or email that registered with LDAP
User can login to lldap dashboard ui to reset password by themself (self-service).
PS: other than password and avatar, I think the rest of Hardcoded attributes should not be Editable by default (in centralized identity source managed by admin), since they also can impersonate someone name, it's also used by some of Platform/Services when integrated to LDAP. cmiiw
@nitnelave commented on GitHub (Jul 1, 2025):
There's something I have trouble following:
Small reminder on the scope of LLDAP: this is primarily meant for small self-hosted servers for friends/family/trusted group of users. For instance, I don't think it's very hard to DDoS. I would argue that your security concern falls outside of that scope.
That said, I'm open to a PR making the relevant hardcoded attributes possible to lock.
@kgfathur commented on GitHub (Jul 1, 2025):
Thanks for the quick response to this concern and discussion, really appreciate it!
Got it, that makes sense now. I realize this is out of scope for the LLDAP project goals — thanks for pointing it out and taking the time to respond!
Thanks for being open to PRs! I’d love to help... unfortunately I’m more of a sysadmin than a coder, so unless it's written in bash or happens in a terminal, I might be out of my depth 😅