File tree Expand file tree Collapse file tree
java/ql/test/library-tests/dataflow/taint-jackson Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import java
2- import semmle.code.java.dataflow.DataFlow
3- import semmle.code.java.dataflow.TaintTracking
4- import semmle.code.java.dataflow.FlowSources
5- import TestUtilities.InlineExpectationsTest
2+ import TestUtilities.InlineFlowTest
63
7- class Conf extends TaintTracking:: Configuration {
8- Conf ( ) { this = "qltest:dataflow:jackson" }
9-
10- override predicate isSource ( DataFlow:: Node n ) {
11- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
12- or
13- n instanceof RemoteFlowSource
14- }
15-
16- override predicate isSink ( DataFlow:: Node n ) {
17- exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
18- }
19- }
20-
21- class HasFlowTest extends InlineExpectationsTest {
22- HasFlowTest ( ) { this = "HasFlowTest" }
23-
24- override string getARelevantTag ( ) { result = "hasTaintFlow" }
25-
26- override predicate hasActualResult ( Location location , string element , string tag , string value ) {
27- tag = "hasTaintFlow" and
28- exists ( DataFlow:: Node src , DataFlow:: Node sink , Conf conf | conf .hasFlow ( src , sink ) |
29- sink .getLocation ( ) = location and
30- element = sink .toString ( ) and
31- value = ""
32- )
33- }
34- }
4+ class HasFlowTest extends InlineFlowTest { }
You can’t perform that action at this time.
0 commit comments