Python: Clarify SensitiveAttributeAccess

The comment about imports was placed wrong. I also realized we didn't
even have a single test-case for
`this.(DataFlow::AttrRead).getAttributeNameExpr() = sensitiveLookupStringConst(classification)`
so I added that (notice that this is only `getattr(foo, x)` and not
`getattr(foo, "password")`)
This commit is contained in:
Rasmus Wriedt Larsen
2021-06-10 14:09:47 +02:00
parent 3819a361b5
commit eb4f168dd4
2 changed files with 7 additions and 2 deletions

View File

@@ -29,6 +29,9 @@ foo = ObjectFromDatabase()
foo.secret # $ SensitiveDataSource=secret
foo.username # $ SensitiveDataSource=id
getattr(foo, "password") # $ SensitiveDataSource=password
x = "password"
getattr(foo, x) # $ SensitiveDataSource=password
# based on variable/parameter names
def my_func(password): # $ SensitiveDataSource=password