-
Notifications
You must be signed in to change notification settings - Fork 155
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
Is there some method to securely build a filter / Distinguished name? #151
Comments
No. There is nothing like this currently. Happy to take PRs related with this. |
I'm thinking of moving the "LdapEncoder" from Microsofts AntiXSS-package to this library, as the package has reached end of life. I think the license should be compatible and allow to do this, what do you think?
This is how I use it:
Unfortunately I cannot pass an encoded Dn to the Bind-command - but I think this should not be an security issue as it does some encoding magic behind the scenes? |
I am currently trying to protect against injection attacks, e.g. by users providing a username with special characters, like described here.
Before building my own validation logic, I'd like to ask: Is there some kind of utility available for building a secure Dn or Filter string? I always prefer using peer reviewed security logic instead of rolling my own.
I had a look into Utilclass/Dn and Utilclass/Rdn, but they seem to not check much - Rdn checks that there is only one Rdn when using
new Rdn($"uid={username}")
but this does not protect against something like an asterisk. The other parts just seem like quite straight forward parsing & ToString-Methods.I'd appreciate any hints.
Thanks & best regards,
Christoph
P.S.: If there are no predefined helpers for this, my measures probably will be:
Microsoft.Security.Application.Encoder.LdapFilterEncode
- method from MicrosoftsAntiXSS
- Package.Some of those might be redundant, but better be safe than sorry ;)
The text was updated successfully, but these errors were encountered: