File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
csharp/ql/test/library-tests/frameworks/JsonNET Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1
1
import csharp
2
2
3
- class Configuration extends TaintTracking :: Configuration {
4
- Configuration ( ) { this = "Json.NET test " }
3
+ module TaintConfig implements DataFlow :: ConfigSig {
4
+ predicate isSource ( DataFlow :: Node src ) { src . asExpr ( ) . ( StringLiteral ) . getValue ( ) = "tainted " }
5
5
6
- override predicate isSource ( DataFlow:: Node src ) {
7
- src .asExpr ( ) .( StringLiteral ) .getValue ( ) = "tainted"
8
- }
9
-
10
- override predicate isSink ( DataFlow:: Node sink ) {
6
+ predicate isSink ( DataFlow:: Node sink ) {
11
7
exists ( MethodCall c | c .getArgument ( 0 ) = sink .asExpr ( ) and c .getTarget ( ) .getName ( ) = "Sink" )
12
8
}
13
9
}
14
10
15
- from Configuration c , DataFlow:: Node source , DataFlow:: Node sink
16
- where c .hasFlow ( source , sink )
11
+ module Taint = TaintTracking:: Global< TaintConfig > ;
12
+
13
+ from DataFlow:: Node source , DataFlow:: Node sink
14
+ where Taint:: flow ( source , sink )
17
15
select source , sink
You can’t perform that action at this time.
0 commit comments