Merge pull request #9649 from RasmusWL/certificate-modeling

Python/JS/Ruby: Ignore common words (like certain) as sensitive data source
This commit is contained in:
Rasmus Wriedt Larsen
2022-06-23 12:04:58 +02:00
committed by GitHub
7 changed files with 39 additions and 6 deletions

View File

@@ -37,6 +37,10 @@ f = not_found.get_passwd # $ SensitiveDataSource=password
x = f()
print(x) # $ SensitiveUse=password
# some prefixes makes us ignore it as a source
not_found.isSecret
not_found.is_secret
def my_func(non_sensitive_name):
x = non_sensitive_name()
print(x) # $ SensitiveUse=password
@@ -56,6 +60,11 @@ getattr(foo, x) # $ SensitiveDataSource=password
def my_func(password): # $ SensitiveDataSource=password
print(password) # $ SensitiveUse=password
# FP where the `cert` in `uncertainty` makes us treat it like a certificate
# https://github.com/github/codeql/issues/9632
def my_other_func(uncertainty):
print(uncertainty)
password = some_function() # $ SensitiveDataSource=password
print(password) # $ SensitiveUse=password