File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
csharp/ql/test/library-tests/frameworks/NHibernate 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 MyConfiguration extends TaintTracking :: Configuration {
4
- MyConfiguration ( ) { this = "MyConfiguration " }
3
+ module TaintConfig implements DataFlow :: ConfigSig {
4
+ predicate isSource ( DataFlow :: Node node ) { node . asExpr ( ) . ( StringLiteral ) . getValue ( ) = "tainted " }
5
5
6
- override predicate isSource ( DataFlow:: Node node ) {
7
- node .asExpr ( ) .( StringLiteral ) .getValue ( ) = "tainted"
8
- }
9
-
10
- override predicate isSink ( DataFlow:: Node node ) {
6
+ predicate isSink ( DataFlow:: Node node ) {
11
7
exists ( MethodCall mc | mc .getTarget ( ) .hasName ( "Sink" ) and node .asExpr ( ) = mc .getArgument ( 0 ) )
12
8
}
13
9
}
14
10
15
- from MyConfiguration config , DataFlow:: Node source , DataFlow:: Node sink
16
- where config .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 sink , "Data flow from $@." , source , source .toString ( )
You can’t perform that action at this time.
0 commit comments