@@ -5,20 +5,14 @@ import semmle.code.java.security.XSS
5
5
import semmle.code.java.security.UrlRedirect
6
6
import TestUtilities.InlineFlowTest
7
7
8
- class EnableLegacy extends EnableLegacyConfiguration {
9
- EnableLegacy ( ) { exists ( this ) }
10
- }
11
-
12
- class Conf extends TaintTracking:: Configuration {
13
- Conf ( ) { this = "qltest:frameworks:apache-http" }
14
-
15
- override predicate isSource ( DataFlow:: Node n ) {
8
+ module Config implements DataFlow:: ConfigSig {
9
+ predicate isSource ( DataFlow:: Node n ) {
16
10
n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
17
11
or
18
12
n instanceof RemoteFlowSource
19
13
}
20
14
21
- override predicate isSink ( DataFlow:: Node n ) {
15
+ predicate isSink ( DataFlow:: Node n ) {
22
16
exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
23
17
or
24
18
n instanceof XssSink
@@ -27,8 +21,10 @@ class Conf extends TaintTracking::Configuration {
27
21
}
28
22
}
29
23
24
+ module Flow = TaintTracking:: Global< Config > ;
25
+
30
26
class HasFlowTest extends InlineFlowTest {
31
- override DataFlow:: Configuration getValueFlowConfig ( ) { none ( ) }
27
+ override predicate hasValueFlow ( DataFlow:: Node src , DataFlow :: Node sink ) { none ( ) }
32
28
33
- override DataFlow:: Configuration getTaintFlowConfig ( ) { result = any ( Conf c ) }
29
+ override predicate hasTaintFlow ( DataFlow:: Node src , DataFlow :: Node sink ) { Flow :: flow ( src , sink ) }
34
30
}
0 commit comments