@@ -10,34 +10,38 @@ private predicate outRefDef(DataFlow::ExprNode ne, int outRef) {
10
10
)
11
11
}
12
12
13
- class Configuration extends DataFlow:: Configuration {
14
- Configuration ( ) { this = "Configuration" }
13
+ module Config implements DataFlow:: ConfigSig {
14
+ predicate isSource ( DataFlow :: Node source ) { source instanceof DataFlow :: ParameterNode }
15
15
16
- override predicate isSource ( DataFlow:: Node source ) { source instanceof DataFlow:: ParameterNode }
17
-
18
- override predicate isSink ( DataFlow:: Node sink ) {
16
+ predicate isSink ( DataFlow:: Node sink ) {
19
17
any ( Callable c ) .canReturn ( sink .asExpr ( ) ) or outRefDef ( sink , _)
20
18
}
21
19
22
- override predicate isBarrier ( DataFlow:: Node node ) {
20
+ predicate isBarrier ( DataFlow:: Node node ) {
23
21
exists ( AbstractValues:: NullValue nv | node .( GuardedDataFlowNode ) .mustHaveValue ( nv ) |
24
22
nv .isNull ( )
25
23
)
26
24
}
27
25
}
28
26
29
- predicate flowOutFromParameter ( DataFlow:: Configuration c , Parameter p ) {
30
- exists ( DataFlow:: ExprNode ne , DataFlow:: ParameterNode np |
31
- p .getCallable ( ) .canReturn ( ne .getExpr ( ) ) and
32
- np .getParameter ( ) = p and
33
- c .hasFlow ( np , ne )
34
- )
35
- }
27
+ module FlowOut< DataFlow:: GlobalFlowSig Input> {
28
+ predicate flowOutFromParameter ( Parameter p ) {
29
+ exists ( DataFlow:: ExprNode ne , DataFlow:: ParameterNode np |
30
+ p .getCallable ( ) .canReturn ( ne .getExpr ( ) ) and
31
+ np .getParameter ( ) = p and
32
+ Input:: flow ( np , ne )
33
+ )
34
+ }
36
35
37
- predicate flowOutFromParameterOutOrRef ( DataFlow:: Configuration c , Parameter p , int outRef ) {
38
- exists ( DataFlow:: ExprNode ne , DataFlow:: ParameterNode np |
39
- outRefDef ( ne , outRef ) and
40
- np .getParameter ( ) = p and
41
- c .hasFlow ( np , ne )
42
- )
36
+ predicate flowOutFromParameterOutOrRef ( Parameter p , int outRef ) {
37
+ exists ( DataFlow:: ExprNode ne , DataFlow:: ParameterNode np |
38
+ outRefDef ( ne , outRef ) and
39
+ np .getParameter ( ) = p and
40
+ Input:: flow ( np , ne )
41
+ )
42
+ }
43
43
}
44
+
45
+ module Data = FlowOut< DataFlow:: Global< Config > > ;
46
+
47
+ module Taint = FlowOut< TaintTracking:: Global< Config > > ;
0 commit comments