Skip to content

Commit 499adc2

Browse files
committed
Python: Extend SensitiveDataSource tests
Now it contains all the sort of things we actually support 👍
1 parent 794a86a commit 499adc2

File tree

1 file changed

+12
-0
lines changed
  • python/ql/test/experimental/dataflow/sensitive-data

1 file changed

+12
-0
lines changed

python/ql/test/experimental/dataflow/sensitive-data/test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@ def encrypt_password(pwd):
1919
fetch_certificate() # $ SensitiveDataSource=certificate
2020
account_id() # $ SensitiveDataSource=id
2121
safe_to_store = encrypt_password(pwd)
22+
23+
# attributes
24+
foo = ObjectFromDatabase()
25+
foo.secret # $ SensitiveDataSource=secret
26+
foo.username # $ SensitiveDataSource=id
27+
28+
# Special handling of lookups of sensitive properties
29+
request.args["password"], # $ MISSING: SensitiveDataSource=password
30+
request.args.get("password") # $ SensitiveDataSource=password
31+
32+
# I don't think handling `getlist` is super important, just included it to show what we don't handle
33+
request.args.getlist("password")[0] # $ MISSING: SensitiveDataSource=password

0 commit comments

Comments
 (0)