Skip to content
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

Review user attributes fetched for auth_state - could end up not being the users without an error being raised? #295

Closed
consideRatio opened this issue Nov 1, 2024 · 0 comments · Fixed by #294

Comments

@consideRatio
Copy link
Member

consideRatio commented Nov 1, 2024

Extracted from #294 (comment)

Regarding this code:

    def get_user_attributes(self, conn, userdn):
        attrs = {}
        if self.auth_state_attributes:
            found = conn.search(
                search_base=userdn,
                search_scope=ldap3.SUBTREE,
                search_filter="(objectClass=*)",
                attributes=self.auth_state_attributes,
            )
            # FIXME: Handle situations with multiple entries below or comment
            #        why its not important to do.
            #
            if found:
                attrs = conn.entries[0].entry_attributes_as_dict
        return attrs

@manics wrote:

Maybe we should throw an error, same as in resolve_username? If there's a possibility of the entries corresponding to different Identities this implies a change in the LDAP server could lead to a different ordering of responses, resulting in a user gaining access to another user's account.

If it's two entries for the same user we still need to understand what the difference is, in case some attributes are different which could lead to inconsistent configuration of the singleuser server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant