1
+ // /**
2
+ // * @kind path-problem
3
+ // */
1
4
import python
2
5
import semmle.python.dataflow.new.DataFlow
3
6
import semmle.python.dataflow.new.TaintTracking
@@ -19,8 +22,7 @@ class SensitiveDataSourcesTest extends InlineExpectationsTest {
19
22
tag = "SensitiveDataSource"
20
23
or
21
24
exists ( DataFlow:: Node use |
22
- use = API:: builtin ( "print" ) .getACall ( ) .getArg ( _) and
23
- TaintTracking:: localTaint ( source , use ) and
25
+ any ( SensitiveUseConfiguration config ) .hasFlow ( source , use ) and
24
26
location = use .getLocation ( ) and
25
27
element = use .toString ( ) and
26
28
value = source .getClassification ( ) and
@@ -29,3 +31,17 @@ class SensitiveDataSourcesTest extends InlineExpectationsTest {
29
31
)
30
32
}
31
33
}
34
+
35
+ class SensitiveUseConfiguration extends TaintTracking:: Configuration {
36
+ SensitiveUseConfiguration ( ) { this = "SensitiveUseConfiguration" }
37
+
38
+ override predicate isSource ( DataFlow:: Node node ) { node instanceof SensitiveDataSource }
39
+
40
+ override predicate isSink ( DataFlow:: Node node ) {
41
+ node = API:: builtin ( "print" ) .getACall ( ) .getArg ( _)
42
+ }
43
+ }
44
+ // import DataFlow::PathGraph
45
+ // from SensitiveUseConfiguration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
46
+ // where cfg.hasFlowPath(source, sink)
47
+ // select sink, source, sink, "taint from $@", source.getNode(), "here"
0 commit comments