File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/semmle/python/dataflow/new
test/experimental/dataflow/sensitive-data Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ private module SensitiveDataModeling {
126
126
override SensitiveDataClassification getClassification ( ) { result = classification }
127
127
}
128
128
129
+ /** A subscript, where the key indicates the result will be sensitive data. */
130
+ class SensitiveSubscript extends SensitiveDataSource:: Range {
131
+ SensitiveDataClassification classification ;
132
+
133
+ SensitiveSubscript ( ) {
134
+ this .asCfgNode ( ) .( SubscriptNode ) .getIndex ( ) =
135
+ sensitiveLookupStringConst ( classification ) .asCfgNode ( )
136
+ }
137
+
138
+ override SensitiveDataClassification getClassification ( ) { result = classification }
139
+ }
140
+
129
141
/** A call to `get` on an object, where the key indicates the result will be sensitive data. */
130
142
class SensitiveGetCall extends SensitiveDataSource:: Range , DataFlow:: CallCfgNode {
131
143
SensitiveDataClassification classification ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def encrypt_password(pwd):
34
34
print (password ) # $ MISSING: SensitiveUse=password
35
35
36
36
# Special handling of lookups of sensitive properties
37
- request .args ["password" ], # $ MISSING: SensitiveDataSource=password
37
+ request .args ["password" ], # $ SensitiveDataSource=password
38
38
request .args .get ("password" ) # $ SensitiveDataSource=password
39
39
40
40
x = "password"
You can’t perform that action at this time.
0 commit comments