@@ -76,28 +76,16 @@ private module SensitiveDataModeling {
7676 }
7777
7878 /**
79- * Gets a reference to a string constant that, if used as the key in a lookup,
80- * indicates the presence of sensitive data with `classification`.
81- */
82- private DataFlow:: LocalSourceNode sensitiveLookupStringConst (
83- DataFlow:: TypeTracker t , SensitiveDataClassification classification
84- ) {
85- t .start ( ) and
86- nameIndicatesSensitiveData ( result .asExpr ( ) .( StrConst ) .getText ( ) , classification )
87- or
88- exists ( DataFlow:: TypeTracker t2 |
89- result = sensitiveLookupStringConst ( t2 , classification ) .track ( t2 , t )
90- )
91- }
92-
93- /**
94- * Gets a reference to a string constant that, if used as the key in a lookup,
95- * indicates the presence of sensitive data with `classification`.
96- *
97- * Also see `extraStepForCalls`.
79+ * Gets a reference (in local scope) to a string constant that, if used as the key in
80+ * a lookup, indicates the presence of sensitive data with `classification`.
9881 */
9982 DataFlow:: Node sensitiveLookupStringConst ( SensitiveDataClassification classification ) {
100- sensitiveLookupStringConst ( DataFlow:: TypeTracker:: end ( ) , classification ) .flowsTo ( result )
83+ // Note: If this is implemented with type-tracking, we will get cross-talk as
84+ // illustrated in python/ql/test/experimental/dataflow/sensitive-data/test.py
85+ exists ( DataFlow:: LocalSourceNode source |
86+ nameIndicatesSensitiveData ( source .asExpr ( ) .( StrConst ) .getText ( ) , classification ) and
87+ source .flowsTo ( result )
88+ )
10189 }
10290
10391 /** A function call that is considered a source of sensitive data. */
@@ -118,6 +106,8 @@ private module SensitiveDataModeling {
118106 /**
119107 * Tracks any modeled source of sensitive data (with any classification),
120108 * to limit the scope of `extraStepForCalls`. See it's QLDoc for more context.
109+ *
110+ * Also see `extraStepForCalls`.
121111 */
122112 private DataFlow:: LocalSourceNode possibleSensitiveCallable ( DataFlow:: TypeTracker t ) {
123113 t .start ( ) and
@@ -129,6 +119,8 @@ private module SensitiveDataModeling {
129119 /**
130120 * Tracks any modeled source of sensitive data (with any classification),
131121 * to limit the scope of `extraStepForCalls`. See it's QLDoc for more context.
122+ *
123+ * Also see `extraStepForCalls`.
132124 */
133125 private DataFlow:: Node possibleSensitiveCallable ( ) {
134126 possibleSensitiveCallable ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result )
0 commit comments