@@ -9,22 +9,20 @@ import semmle.code.java.security.InsecureLdapAuth
9
9
/**
10
10
* A taint-tracking configuration for `ldap://` URL in LDAP authentication.
11
11
*/
12
- class InsecureUrlFlowConfig extends TaintTracking:: Configuration {
13
- InsecureUrlFlowConfig ( ) { this = "InsecureLdapAuth:InsecureUrlFlowConfig" }
14
-
12
+ private module InsecureUrlFlowConfig implements DataFlow:: ConfigSig {
15
13
/** Source of `ldap://` connection string. */
16
- override predicate isSource ( DataFlow:: Node src ) { src .asExpr ( ) instanceof InsecureLdapUrl }
14
+ predicate isSource ( DataFlow:: Node src ) { src .asExpr ( ) instanceof InsecureLdapUrl }
17
15
18
16
/** Sink of directory context creation. */
19
- override predicate isSink ( DataFlow:: Node sink ) {
17
+ predicate isSink ( DataFlow:: Node sink ) {
20
18
exists ( ConstructorCall cc |
21
19
cc .getConstructedType ( ) .getAnAncestor ( ) instanceof TypeDirContext and
22
20
sink .asExpr ( ) = cc .getArgument ( 0 )
23
21
)
24
22
}
25
23
26
24
/** Method call of `env.put()`. */
27
- override predicate isAdditionalTaintStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
25
+ predicate isAdditionalFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
28
26
exists ( MethodAccess ma |
29
27
pred .asExpr ( ) = ma .getArgument ( 1 ) and
30
28
isProviderUrlSetter ( ma ) and
@@ -33,46 +31,48 @@ class InsecureUrlFlowConfig extends TaintTracking::Configuration {
33
31
}
34
32
}
35
33
34
+ module InsecureUrlFlowConfiguration = TaintTracking:: Make< InsecureUrlFlowConfig > ;
35
+
36
36
/**
37
37
* A taint-tracking configuration for `simple` basic-authentication in LDAP configuration.
38
38
*/
39
- class BasicAuthFlowConfig extends DataFlow:: Configuration {
40
- BasicAuthFlowConfig ( ) { this = "InsecureLdapAuth:BasicAuthFlowConfig" }
41
-
39
+ private module BasicAuthFlowConfig implements DataFlow:: ConfigSig {
42
40
/** Source of `simple` configuration. */
43
- override predicate isSource ( DataFlow:: Node src ) {
41
+ predicate isSource ( DataFlow:: Node src ) {
44
42
exists ( MethodAccess ma |
45
43
isBasicAuthEnv ( ma ) and ma .getQualifier ( ) = src .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( )
46
44
)
47
45
}
48
46
49
47
/** Sink of directory context creation. */
50
- override predicate isSink ( DataFlow:: Node sink ) {
48
+ predicate isSink ( DataFlow:: Node sink ) {
51
49
exists ( ConstructorCall cc |
52
50
cc .getConstructedType ( ) .getAnAncestor ( ) instanceof TypeDirContext and
53
51
sink .asExpr ( ) = cc .getArgument ( 0 )
54
52
)
55
53
}
56
54
}
57
55
56
+ module BasicAuthFlowConfiguration = DataFlow:: Make< BasicAuthFlowConfig > ;
57
+
58
58
/**
59
59
* A taint-tracking configuration for `ssl` configuration in LDAP authentication.
60
60
*/
61
- class SslFlowConfig extends DataFlow:: Configuration {
62
- SslFlowConfig ( ) { this = "InsecureLdapAuth:SSLFlowConfig" }
63
-
61
+ private module SslFlowConfig implements DataFlow:: ConfigSig {
64
62
/** Source of `ssl` configuration. */
65
- override predicate isSource ( DataFlow:: Node src ) {
63
+ predicate isSource ( DataFlow:: Node src ) {
66
64
exists ( MethodAccess ma |
67
65
isSslEnv ( ma ) and ma .getQualifier ( ) = src .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( )
68
66
)
69
67
}
70
68
71
69
/** Sink of directory context creation. */
72
- override predicate isSink ( DataFlow:: Node sink ) {
70
+ predicate isSink ( DataFlow:: Node sink ) {
73
71
exists ( ConstructorCall cc |
74
72
cc .getConstructedType ( ) .getAnAncestor ( ) instanceof TypeDirContext and
75
73
sink .asExpr ( ) = cc .getArgument ( 0 )
76
74
)
77
75
}
78
76
}
77
+
78
+ module SslFlowConfiguration = DataFlow:: Make< SslFlowConfig > ;
0 commit comments