@@ -9,22 +9,20 @@ import semmle.code.java.security.InsecureLdapAuth
99/**
1010 * A taint-tracking configuration for `ldap://` URL in LDAP authentication.
1111 */
12- class InsecureUrlFlowConfig extends TaintTracking:: Configuration {
13- InsecureUrlFlowConfig ( ) { this = "InsecureLdapAuth:InsecureUrlFlowConfig" }
14-
12+ private module InsecureUrlFlowConfig implements DataFlow:: ConfigSig {
1513 /** 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 }
1715
1816 /** Sink of directory context creation. */
19- override predicate isSink ( DataFlow:: Node sink ) {
17+ predicate isSink ( DataFlow:: Node sink ) {
2018 exists ( ConstructorCall cc |
2119 cc .getConstructedType ( ) .getAnAncestor ( ) instanceof TypeDirContext and
2220 sink .asExpr ( ) = cc .getArgument ( 0 )
2321 )
2422 }
2523
2624 /** Method call of `env.put()`. */
27- override predicate isAdditionalTaintStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
25+ predicate isAdditionalFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
2826 exists ( MethodAccess ma |
2927 pred .asExpr ( ) = ma .getArgument ( 1 ) and
3028 isProviderUrlSetter ( ma ) and
@@ -33,46 +31,48 @@ class InsecureUrlFlowConfig extends TaintTracking::Configuration {
3331 }
3432}
3533
34+ module InsecureUrlFlowConfiguration = TaintTracking:: Make< InsecureUrlFlowConfig > ;
35+
3636/**
3737 * A taint-tracking configuration for `simple` basic-authentication in LDAP configuration.
3838 */
39- class BasicAuthFlowConfig extends DataFlow:: Configuration {
40- BasicAuthFlowConfig ( ) { this = "InsecureLdapAuth:BasicAuthFlowConfig" }
41-
39+ private module BasicAuthFlowConfig implements DataFlow:: ConfigSig {
4240 /** Source of `simple` configuration. */
43- override predicate isSource ( DataFlow:: Node src ) {
41+ predicate isSource ( DataFlow:: Node src ) {
4442 exists ( MethodAccess ma |
4543 isBasicAuthEnv ( ma ) and ma .getQualifier ( ) = src .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( )
4644 )
4745 }
4846
4947 /** Sink of directory context creation. */
50- override predicate isSink ( DataFlow:: Node sink ) {
48+ predicate isSink ( DataFlow:: Node sink ) {
5149 exists ( ConstructorCall cc |
5250 cc .getConstructedType ( ) .getAnAncestor ( ) instanceof TypeDirContext and
5351 sink .asExpr ( ) = cc .getArgument ( 0 )
5452 )
5553 }
5654}
5755
56+ module BasicAuthFlowConfiguration = DataFlow:: Make< BasicAuthFlowConfig > ;
57+
5858/**
5959 * A taint-tracking configuration for `ssl` configuration in LDAP authentication.
6060 */
61- class SslFlowConfig extends DataFlow:: Configuration {
62- SslFlowConfig ( ) { this = "InsecureLdapAuth:SSLFlowConfig" }
63-
61+ private module SslFlowConfig implements DataFlow:: ConfigSig {
6462 /** Source of `ssl` configuration. */
65- override predicate isSource ( DataFlow:: Node src ) {
63+ predicate isSource ( DataFlow:: Node src ) {
6664 exists ( MethodAccess ma |
6765 isSslEnv ( ma ) and ma .getQualifier ( ) = src .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( )
6866 )
6967 }
7068
7169 /** Sink of directory context creation. */
72- override predicate isSink ( DataFlow:: Node sink ) {
70+ predicate isSink ( DataFlow:: Node sink ) {
7371 exists ( ConstructorCall cc |
7472 cc .getConstructedType ( ) .getAnAncestor ( ) instanceof TypeDirContext and
7573 sink .asExpr ( ) = cc .getArgument ( 0 )
7674 )
7775 }
7876}
77+
78+ module SslFlowConfiguration = DataFlow:: Make< SslFlowConfig > ;
0 commit comments