-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Java: Insecure LDAP authentication #4854
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
Conversation
Acknowledged; will look at this on January 4th or later |
Thanks @smowton. This is also my last planned PR before the holidays. Merry Christmas and Happy New Year! |
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/test/experimental/query-tests/security/CWE-522/InsecureLdapAuth.java
Show resolved
Hide resolved
Looks good, waiting on security-lab to look at the results now. |
Hi @luchua-bc, |
Thanks @JarLob for reviewing this PR. I thought about this one when submitting the first version but finally decided not to include it since it's not that a common configuration. There is no GitHub repository found with this configuration during a quick search when I drafted the query. However, it's nice to have it so that the query can be more comprehensive and can help to reduce possible false positives. I've made requested changes. Please review. Cheers, |
The results are much better now! But it bugs me that the sink is
|
Sorry I don't quite get what you mean. Do you want to make the |
The |
Thanks @smowton for the detailed explanation. As the approach is quite different from my original thoughts, it took me some time to revamp the query. Although I'm still not entirely sure whether it's what we want, the new query does render desired results. Please review. Thanks. |
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.qhelp
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/Security/CWE/CWE-522/InsecureLdapAuth.ql
Outdated
Show resolved
Hide resolved
I don't have any further comments; pinged a Java code-owner to take a look. |
When using the Java LDAP API to perform LDAPv3-style extended operations and controls like user profile retrieval, a context with connection properties including user credentials is started. Transmission of LDAP credentials in cleartext allows remote attackers to obtain sensitive information by sniffing the network.
This query detects transmission of cleartext credentials in LDAP authentication, which meets the following two criteria:
Please consider to merge the PR. Thanks.