14
14
*/
15
15
16
16
import python
17
- import DataFlow:: PathGraph
18
17
import semmle.python.Concepts
19
18
import semmle.python.ApiGraphs
20
19
import semmle.python.dataflow.new.DataFlow
@@ -33,17 +32,19 @@ class DynamicTemplate extends DataFlow::Node {
33
32
}
34
33
}
35
34
36
- class Configuration extends TaintTracking :: Configuration {
37
- Configuration ( ) { this = "AuditXSSJinja2" }
35
+ module Configuration implements DataFlow :: ConfigSig {
36
+ predicate isSource ( DataFlow :: Node source ) { source instanceof ReflectedXss :: Source }
38
37
39
- override predicate isSource ( DataFlow:: Node source ) { source instanceof ReflectedXss :: Source }
38
+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof DynamicTemplate }
40
39
41
- override predicate isSink ( DataFlow:: Node sink ) { sink instanceof DynamicTemplate }
42
-
43
- override predicate isSanitizer ( DataFlow:: Node node ) { node instanceof ReflectedXss:: Sanitizer }
40
+ predicate isBarrier ( DataFlow:: Node node ) { node instanceof ReflectedXss:: Sanitizer }
44
41
}
45
42
46
- from Configuration config , DataFlow:: PathNode source , DataFlow:: PathNode sink
47
- where config .hasFlowPath ( source , sink )
43
+ module ConfigurationFlow = TaintTracking:: Global< Configuration > ;
44
+
45
+ import ConfigurationFlow:: PathGraph //importing the path graph from the module
46
+
47
+ from ConfigurationFlow:: PathNode source , ConfigurationFlow:: PathNode sink
48
+ where ConfigurationFlow:: flowPath ( source , sink )
48
49
select sink .getNode ( ) , source , sink , "Cross-site scripting vulnerability due to a $@." ,
49
50
source .getNode ( ) , "user-provided value"
0 commit comments