Skip to content

Commit 4be3755

Browse files
committed
Python: Handle _ in sensitive-data-sources
1 parent 4a84431 commit 4be3755

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/ql/lib/semmle/python/security/internal/SensitiveDataHeuristics.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module HeuristicNames {
5050
* Gets a regular expression that identifies strings that may indicate the presence of secret
5151
* or trusted data.
5252
*/
53-
string maybeSecret() { result = "(?is).*((?<!is)secret|(?<!un|is)trusted).*" }
53+
string maybeSecret() { result = "(?is).*((?<!is|is_)secret|(?<!un|un_|is|is_)trusted).*" }
5454

5555
/**
5656
* Gets a regular expression that identifies strings that may indicate the presence of

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def encrypt_password(pwd):
3939

4040
# some prefixes makes us ignore it as a source
4141
not_found.isSecret
42-
not_found.is_secret # $ SPURIOUS: SensitiveDataSource=secret
42+
not_found.is_secret
4343

4444
def my_func(non_sensitive_name):
4545
x = non_sensitive_name()

0 commit comments

Comments
 (0)