@@ -9,37 +9,43 @@ private import semmle.python.dataflow.new.internal.TaintTrackingPublic
99 */
1010predicate defaultTaintSanitizer ( DataFlow:: Node node ) { none ( ) }
1111
12- /**
13- * Holds if the additional step from `nodeFrom` to `nodeTo` should be included in all
14- * global taint flow configurations.
15- */
16- predicate defaultAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
17- localAdditionalTaintStep ( nodeFrom , nodeTo )
18- or
19- any ( AdditionalTaintStep a ) .step ( nodeFrom , nodeTo )
20- }
12+ private module Cached {
13+ /**
14+ * Holds if the additional step from `nodeFrom` to `nodeTo` should be included in all
15+ * global taint flow configurations.
16+ */
17+ cached
18+ predicate defaultAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
19+ localAdditionalTaintStep ( nodeFrom , nodeTo )
20+ or
21+ any ( AdditionalTaintStep a ) .step ( nodeFrom , nodeTo )
22+ }
2123
22- /**
23- * Holds if taint can flow in one local step from `nodeFrom` to `nodeTo` excluding
24- * local data flow steps. That is, `nodeFrom` and `nodeTo` are likely to represent
25- * different objects.
26- */
27- predicate localAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
28- concatStep ( nodeFrom , nodeTo )
29- or
30- subscriptStep ( nodeFrom , nodeTo )
31- or
32- stringManipulation ( nodeFrom , nodeTo )
33- or
34- containerStep ( nodeFrom , nodeTo )
35- or
36- copyStep ( nodeFrom , nodeTo )
37- or
38- forStep ( nodeFrom , nodeTo )
39- or
40- unpackingAssignmentStep ( nodeFrom , nodeTo )
24+ /**
25+ * Holds if taint can flow in one local step from `nodeFrom` to `nodeTo` excluding
26+ * local data flow steps. That is, `nodeFrom` and `nodeTo` are likely to represent
27+ * different objects.
28+ */
29+ cached
30+ predicate localAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
31+ concatStep ( nodeFrom , nodeTo )
32+ or
33+ subscriptStep ( nodeFrom , nodeTo )
34+ or
35+ stringManipulation ( nodeFrom , nodeTo )
36+ or
37+ containerStep ( nodeFrom , nodeTo )
38+ or
39+ copyStep ( nodeFrom , nodeTo )
40+ or
41+ forStep ( nodeFrom , nodeTo )
42+ or
43+ unpackingAssignmentStep ( nodeFrom , nodeTo )
44+ }
4145}
4246
47+ import Cached
48+
4349/**
4450 * Holds if taint can flow from `nodeFrom` to `nodeTo` with a step related to concatenation.
4551 *
0 commit comments