@@ -76,28 +76,16 @@ private module SensitiveDataModeling {
76
76
}
77
77
78
78
/**
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`.
98
81
*/
99
82
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
+ )
101
89
}
102
90
103
91
/** A function call that is considered a source of sensitive data. */
@@ -118,6 +106,8 @@ private module SensitiveDataModeling {
118
106
/**
119
107
* Tracks any modeled source of sensitive data (with any classification),
120
108
* to limit the scope of `extraStepForCalls`. See it's QLDoc for more context.
109
+ *
110
+ * Also see `extraStepForCalls`.
121
111
*/
122
112
private DataFlow:: LocalSourceNode possibleSensitiveCallable ( DataFlow:: TypeTracker t ) {
123
113
t .start ( ) and
@@ -129,6 +119,8 @@ private module SensitiveDataModeling {
129
119
/**
130
120
* Tracks any modeled source of sensitive data (with any classification),
131
121
* to limit the scope of `extraStepForCalls`. See it's QLDoc for more context.
122
+ *
123
+ * Also see `extraStepForCalls`.
132
124
*/
133
125
private DataFlow:: Node possibleSensitiveCallable ( ) {
134
126
possibleSensitiveCallable ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result )
0 commit comments