1
1
/** Provides classes to reason about insecure LDAP authentication. */
2
2
3
3
import java
4
- import semmle.code.java.frameworks.Networking
5
- import semmle.code.java.frameworks.Jndi
4
+ private import semmle.code.java.frameworks.Networking
5
+ private import semmle.code.java.frameworks.Jndi
6
6
7
7
/**
8
8
* An insecure (non-SSL, non-private) LDAP URL string literal.
9
9
*/
10
- class InsecureLdapUrlLiteral extends StringLiteral {
10
+ private class InsecureLdapUrlLiteral extends StringLiteral {
11
11
InsecureLdapUrlLiteral ( ) {
12
12
// Match connection strings with the LDAP protocol and without private IP addresses to reduce false positives.
13
13
exists ( string s | this .getValue ( ) = s |
@@ -18,7 +18,7 @@ class InsecureLdapUrlLiteral extends StringLiteral {
18
18
}
19
19
20
20
/** The class `java.util.Hashtable`. */
21
- class TypeHashtable extends Class {
21
+ private class TypeHashtable extends Class {
22
22
TypeHashtable ( ) { this .getSourceDeclaration ( ) .hasQualifiedName ( "java.util" , "Hashtable" ) }
23
23
}
24
24
@@ -86,7 +86,7 @@ predicate hasFieldValueEnv(MethodAccess ma, string fieldValue, string envValue)
86
86
* Holds if `ma` sets attribute name `fieldName` to `envValue` in some `Hashtable`.
87
87
*/
88
88
bindingset [ fieldName, envValue]
89
- predicate hasFieldNameEnv ( MethodAccess ma , string fieldName , string envValue ) {
89
+ private predicate hasFieldNameEnv ( MethodAccess ma , string fieldName , string envValue ) {
90
90
// environment.put(Context.SECURITY_AUTHENTICATION, "simple")
91
91
ma .getMethod ( ) .getDeclaringType ( ) .getAnAncestor ( ) instanceof TypeHashtable and
92
92
ma .getMethod ( ) .hasName ( [ "put" , "setProperty" ] ) and
0 commit comments