Will the C# DirectoryEntry
class vulnerable to LDAP Injection from the parameters of it constructor?
For example:
DirectoryEntry de = new DirectoryEntry(path, username, txtPassword.Text, AuthenticationTypes.Secure);
DirectorySearcher search = new DirectorySearcher(de);
search.Filter = "(ACName=" + username + ")";
search.SearchScope = SearchScope.Subtree;
search.CacheResults = false;
...
I know that it is vulnerable to LDAP injection on the search.Filter
, if the application accept user input without encoding / validation and set to search.Filter
.
Will it cause any LDAP Injection vulnerability on the parameters of DirectoryEntry
constructor like path, username, password if I did not validate / encode the user input and pass directly to the constructor?
Is there any others LDAP Injection point that I need to careful when I use user input?