Skip to content

Add check for undefined UUID#770

Merged
SISheogorath merged 1 commit intohackmdio:masterfrom
SISheogorath:fix/ldapUUID
Mar 18, 2018
Merged

Add check for undefined UUID#770
SISheogorath merged 1 commit intohackmdio:masterfrom
SISheogorath:fix/ldapUUID

Conversation

@SISheogorath
Copy link
Copy Markdown
Contributor

This check is needed at there are tons of LDAP implementations out there
and none has at least one guaranteed unique field. As we currently check
three fields and added an option to select one yourself, it's still not
said that any of these fields is set. This will now create an error
and fail the authentication instead of letting people may get access to
other people's notes which are stored under a this way deterministic
wrong userid named LDAP-undefined.

Fixes #764

@fooker would you like to review and test this?

@SISheogorath SISheogorath added bug Something isn't working security labels Mar 17, 2018
Comment thread lib/web/auth/ldap/index.js Outdated
username = user[config.ldap.usernameField]
}

if (typeof uuid === 'undefined') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be moved up before the username code. If the username field is not used, this will say something like Could not determine UUID for LDAP user "undefined".

@fooker
Copy link
Copy Markdown
Contributor

fooker commented Mar 17, 2018

Looks got to me.

This check is needed at there are tons of LDAP implementations out there
and none has at least one guaranteed unique field. As we currently check
three fields and added an option to select one yourself, it's still not
said that any of these fields is set. This will now create an error
and fail the authentication instead of letting people may get access to
other people's notes which are stored under a this way deterministic
wrong userid named `LDAP-undefined`.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
@SISheogorath SISheogorath merged commit 5361a97 into hackmdio:master Mar 18, 2018
@SISheogorath SISheogorath deleted the fix/ldapUUID branch March 18, 2018 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants