File tree Expand file tree Collapse file tree 2 files changed +8
-38
lines changed
library-tests/frameworks/JaxWs Expand file tree Collapse file tree 2 files changed +8
-38
lines changed Original file line number Diff line number Diff line change @@ -7,24 +7,28 @@ class DefaultValueFlowConf extends DataFlow::Configuration {
7
7
DefaultValueFlowConf ( ) { this = "qltest:defaultValueFlowConf" }
8
8
9
9
override predicate isSource ( DataFlow:: Node n ) {
10
- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "source" )
10
+ n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .getName ( ) = [ "source" , "taint" ]
11
11
}
12
12
13
13
override predicate isSink ( DataFlow:: Node n ) {
14
14
exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
15
15
}
16
+
17
+ override int fieldFlowBranchLimit ( ) { result = 1000 }
16
18
}
17
19
18
20
class DefaultTaintFlowConf extends TaintTracking:: Configuration {
19
21
DefaultTaintFlowConf ( ) { this = "qltest:defaultTaintFlowConf" }
20
22
21
23
override predicate isSource ( DataFlow:: Node n ) {
22
- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "source" )
24
+ n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .getName ( ) = [ "source" , "taint" ]
23
25
}
24
26
25
27
override predicate isSink ( DataFlow:: Node n ) {
26
- n . asExpr ( ) . ( Argument ) . getCall ( ) . getCallee ( ) . hasName ( "sink" )
28
+ exists ( MethodAccess ma | ma . getMethod ( ) . hasName ( "sink" ) | n . asExpr ( ) = ma . getAnArgument ( ) )
27
29
}
30
+
31
+ override int fieldFlowBranchLimit ( ) { result = 1000 }
28
32
}
29
33
30
34
class InlineFlowTest extends InlineExpectationsTest {
Original file line number Diff line number Diff line change 1
1
import java
2
- import semmle.code.java.dataflow.TaintTracking
3
2
import TestUtilities.InlineFlowTest
4
3
5
- class TaintFlowConf extends TaintTracking:: Configuration {
6
- TaintFlowConf ( ) { this = "qltest:frameworks:jax-rs-taint" }
7
-
8
- override predicate isSource ( DataFlow:: Node n ) {
9
- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
10
- }
11
-
12
- override predicate isSink ( DataFlow:: Node n ) {
13
- exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
14
- }
15
-
16
- override int fieldFlowBranchLimit ( ) { result = 1000 }
17
- }
18
-
19
- class ValueFlowConf extends DataFlow:: Configuration {
20
- ValueFlowConf ( ) { this = "qltest:frameworks:jax-rs-value" }
21
-
22
- override predicate isSource ( DataFlow:: Node n ) {
23
- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
24
- }
25
-
26
- override predicate isSink ( DataFlow:: Node n ) {
27
- exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
28
- }
29
-
30
- // TODO: move to default?
31
- override int fieldFlowBranchLimit ( ) { result = 1000 }
32
- }
33
-
34
- class HasFlowTest extends InlineFlowTest {
35
- override DataFlow:: Configuration getValueFlowConfig ( ) { result = any ( ValueFlowConf config ) }
36
-
37
- override DataFlow:: Configuration getTaintFlowConfig ( ) { result = any ( TaintFlowConf config ) }
38
- }
4
+ class HasFlowTest extends InlineFlowTest { }
You can’t perform that action at this time.
0 commit comments