@@ -4,7 +4,6 @@ private import semmle.python.objects.ObjectInternal
44private import semmle.python.dataflow.Implementation
55
66module TaintTracking {
7-
87 class Source = TaintSource ;
98
109 class Sink = TaintSink ;
@@ -16,13 +15,11 @@ module TaintTracking {
1615 class PathSink = TaintTrackingNode ;
1716
1817 abstract class Configuration extends string {
19-
2018 /* Required to prevent compiler warning */
2119 bindingset [ this ]
2220 Configuration ( ) { this = this }
2321
2422 /* Old implementation API */
25-
2623 predicate isSource ( Source src ) { none ( ) }
2724
2825 predicate isSink ( Sink sink ) { none ( ) }
@@ -32,7 +29,6 @@ module TaintTracking {
3229 predicate isExtension ( Extension extension ) { none ( ) }
3330
3431 /* New implementation API */
35-
3632 /**
3733 * Holds if `src` is a source of taint of `kind` that is relevant
3834 * for this configuration.
@@ -66,7 +62,9 @@ module TaintTracking {
6662 /**
6763 * Holds if `src -> dest` is a flow edge converting taint from `srckind` to `destkind`.
6864 */
69- predicate isAdditionalFlowStep ( DataFlow:: Node src , DataFlow:: Node dest , TaintKind srckind , TaintKind destkind ) {
65+ predicate isAdditionalFlowStep (
66+ DataFlow:: Node src , DataFlow:: Node dest , TaintKind srckind , TaintKind destkind
67+ ) {
7068 none ( )
7169 }
7270
@@ -79,9 +77,7 @@ module TaintTracking {
7977 * Holds if `node` should be considered as a barrier to flow of `kind`.
8078 */
8179 predicate isBarrier ( DataFlow:: Node node , TaintKind kind ) {
82- exists ( Sanitizer sanitizer |
83- this .isSanitizer ( sanitizer )
84- |
80+ exists ( Sanitizer sanitizer | this .isSanitizer ( sanitizer ) |
8581 sanitizer .sanitizingNode ( kind , node .asCfgNode ( ) )
8682 or
8783 sanitizer .sanitizingEdge ( kind , node .asVariable ( ) )
@@ -112,16 +108,18 @@ module TaintTracking {
112108 * Holds if flow from `src` to `dest` is prohibited when the incoming taint is `srckind` and the outgoing taint is `destkind`.
113109 * Note that `srckind` and `destkind` can be the same.
114110 */
115- predicate isBarrierEdge ( DataFlow:: Node src , DataFlow:: Node dest , TaintKind srckind , TaintKind destkind ) { none ( ) }
111+ predicate isBarrierEdge (
112+ DataFlow:: Node src , DataFlow:: Node dest , TaintKind srckind , TaintKind destkind
113+ ) {
114+ none ( )
115+ }
116116
117117 /* Common query API */
118-
119118 predicate hasFlowPath ( PathSource src , PathSink sink ) {
120119 this .( TaintTrackingImplementation ) .hasFlowPath ( src , sink )
121120 }
122121
123122 /* Old query API */
124-
125123 /* deprecated */
126124 deprecated predicate hasFlow ( Source src , Sink sink ) {
127125 exists ( PathSource psrc , PathSink psink |
@@ -132,15 +130,12 @@ module TaintTracking {
132130 }
133131
134132 /* New query API */
135-
136133 predicate hasSimpleFlow ( DataFlow:: Node src , DataFlow:: Node sink ) {
137134 exists ( PathSource psrc , PathSink psink |
138135 this .hasFlowPath ( psrc , psink ) and
139136 src = psrc .getNode ( ) and
140137 sink = psink .getNode ( )
141138 )
142139 }
143-
144140 }
145-
146141}
0 commit comments