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

fix: add sanitizer to ldap account and password #3372

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

hsinhoyeh
Copy link
Contributor

Overview

this patch draws error when queys (i.e. account / password) against ldap contain wildcard.

What this PR does / why we need it

fixes #3354

Special notes for your reviewer

not sure whether it would impact the existing usecases or not, but I an open to accept additional switcher to on/off.

fixed: dexidp#3354

Signed-off-by: hsinhoyeh <yhh92u@gmail.com>
Signed-off-by: hsinhoyeh <yhh92u@gmail.com>
@hsinhoyeh hsinhoyeh force-pushed the fix---ldap-injection branch from 3a7b1a8 to ccab708 Compare February 23, 2024 16:38
@hsinatfootprintai
Copy link

hi @nabokihms knowing you were busy, but this requires your attention.

@nabokihms
Copy link
Member

Looks good from my point of view. The only thing left is to satisfy the linter.

Signed-off-by: hsinhoyeh <yhh92u@gmail.com>
@hsinhoyeh hsinhoyeh force-pushed the fix---ldap-injection branch from b13fb33 to 8fb472d Compare March 11, 2024 21:24
@hsinhoyeh
Copy link
Contributor Author

Looks good from my point of view. The only thing left is to satisfy the linter.

fixed, thanks @nabokihms

Copy link
Member

@nabokihms nabokihms left a comment

Choose a reason for hiding this comment

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

Let's go with this change without additional flags. It sounds like a sane security improvement./ Hope nobody uses wildcards in passwords.

We can add a feature flag if there are such cases.

@nabokihms nabokihms merged commit 77333d6 into dexidp:master Mar 11, 2024
9 checks passed
@nabokihms
Copy link
Member

@hsinhoyeh thank you for your contribution.

nabokihms added a commit to deckhouse/3p-dex that referenced this pull request Apr 9, 2024
With the change introduced in dexidp#3372 Dex declines passwords that contain special characters. Since password is not passed to any kind of filters, it is safe to pass a password as is. No LDAP query injections are possible.

This commit is a revert of password escaping.

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
nabokihms added a commit that referenced this pull request Apr 9, 2024
With the change introduced in #3372 Dex declines passwords that contain special characters. Since password is not passed to any kind of filters, it is safe to pass a password as is. No LDAP query injections are possible.

This commit is a revert of password escaping.

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
nabokihms added a commit to deckhouse/3p-dex that referenced this pull request Apr 9, 2024
With the change introduced in dexidp#3372 Dex declines passwords that contain special characters. Since password is not passed to any kind of filters, it is safe to pass a password as is. No LDAP query injections are possible.

This commit is a revert of password escaping.

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ldap: add sanitizer for both account and password to prevent ldap injection attacks
3 participants