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

SEC-2141: ActiveDirectoryLdapAuthenticationProvider Should Perform Active Directory SRV Record Lookup when Performing DNS Resolution of Address #2367

Open
spring-projects-issues opened this issue Feb 28, 2013 · 2 comments
Labels
in: ldap An issue in spring-security-ldap type: enhancement A general enhancement type: jira An issue that was migrated from JIRA

Comments

@spring-projects-issues
Copy link

Michael Fazio (Migrated from SEC-2141) said:

It is possible that ActiveDirectoryLdapAuthenticationProvider will fail to authenticate valid users when a domain address is used for the Active Directory host URL (e.g. ldap://corp.domain.com rather than ldap://adserver1.corp.domain.com).

This seems to be caused because the DNS lookup does not specify its request for Active Directory SRV DNS records to be used. Hence, an incorrect server can often be contacted for the target domain.

It would seem that someone has already flagged this issue in code around line 166:

 private DirContext bindAsUser(String username, String password) {
        // TODO. add DNS lookup based on domain
        final String bindUrl = url;
        ...

I believe that the solution is to correctly specify the SRV directory context attribute so that LDAP service DNS lookup is performed, similar to:

Attributes attributes = ctx.getAttributes("_ldap._tcp." + domain, new String[] { "SRV" })
@spring-projects-issues
Copy link
Author

Michael Osipov said:

There is no need to. You are using Digest auth and the RFC requires a fully-qualified domain name. You have provided a CNAME.

@spring-projects-issues
Copy link
Author

Michael Osipov said:

Alternatively, you can provide a URL with a root DN: ldap:///DC=corp,DC=domain,DC=com and Sun's implemenation will automatically look it up in DNS.

@spring-projects-issues spring-projects-issues added in: ldap An issue in spring-security-ldap Open type: enhancement A general enhancement type: jira An issue that was migrated from JIRA labels Feb 5, 2016
@rwinch rwinch removed the Open label May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: ldap An issue in spring-security-ldap type: enhancement A general enhancement type: jira An issue that was migrated from JIRA
Projects
None yet
Development

No branches or pull requests

2 participants