1+ // /**
2+ // * @kind path-problem
3+ // */
14import python
25import semmle.python.dataflow.new.DataFlow
36import semmle.python.dataflow.new.TaintTracking
@@ -19,8 +22,7 @@ class SensitiveDataSourcesTest extends InlineExpectationsTest {
1922 tag = "SensitiveDataSource"
2023 or
2124 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
2426 location = use .getLocation ( ) and
2527 element = use .toString ( ) and
2628 value = source .getClassification ( ) and
@@ -29,3 +31,17 @@ class SensitiveDataSourcesTest extends InlineExpectationsTest {
2931 )
3032 }
3133}
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