File tree Expand file tree Collapse file tree
src/semmle/python/dataflow/new
test/experimental/dataflow/sensitive-data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ private module SensitiveDataModeling {
126126 override SensitiveDataClassification getClassification ( ) { result = classification }
127127 }
128128
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+
129141 /** A call to `get` on an object, where the key indicates the result will be sensitive data. */
130142 class SensitiveGetCall extends SensitiveDataSource:: Range , DataFlow:: CallCfgNode {
131143 SensitiveDataClassification classification ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def encrypt_password(pwd):
3434print (password ) # $ MISSING: SensitiveUse=password
3535
3636# Special handling of lookups of sensitive properties
37- request .args ["password" ], # $ MISSING: SensitiveDataSource=password
37+ request .args ["password" ], # $ SensitiveDataSource=password
3838request .args .get ("password" ) # $ SensitiveDataSource=password
3939
4040x = "password"
You can’t perform that action at this time.
0 commit comments