File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
javascript/ql/lib/semmle/javascript/security/internal
ruby/ql/lib/codeql/ruby/security/internal Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ module HeuristicNames {
50
50
* Gets a regular expression that identifies strings that may indicate the presence of secret
51
51
* or trusted data.
52
52
*/
53
- string maybeSecret ( ) { result = "(?is).*((?<!is)secret|(?<!un|is )trusted).*" }
53
+ string maybeSecret ( ) { result = "(?is).*((?<!is|is_ )secret|(?<!un|un_|is|is_ )trusted).*" }
54
54
55
55
/**
56
56
* Gets a regular expression that identifies strings that may indicate the presence of
@@ -96,10 +96,14 @@ module HeuristicNames {
96
96
* Gets a regular expression that identifies strings that may indicate the presence of data
97
97
* that is hashed or encrypted, and hence rendered non-sensitive, or contains special characters
98
98
* suggesting nouns within the string do not represent the meaning of the whole string (e.g. a URL or a SQL query).
99
+ *
100
+ * We also filter out common words like `certain` and `concert`, since otherwise these could
101
+ * be matched by the certificate regular expressions. Same for `accountable` (account), or
102
+ * `secretarial` (secret).
99
103
*/
100
104
string notSensitiveRegexp ( ) {
101
105
result =
102
- "(?is).*([^\\w$.-]|redact|censor|obfuscate|hash|md5|sha|random|((?<!un)(en))?(crypt|code)).*"
106
+ "(?is).*([^\\w$.-]|redact|censor|obfuscate|hash|md5|sha|random|((?<!un)(en))?(crypt|code)|certain|concert|secretar|accountant|accountab ).*"
103
107
}
104
108
105
109
/**
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ module HeuristicNames {
50
50
* Gets a regular expression that identifies strings that may indicate the presence of secret
51
51
* or trusted data.
52
52
*/
53
- string maybeSecret ( ) { result = "(?is).*((?<!is)secret|(?<!un|is )trusted).*" }
53
+ string maybeSecret ( ) { result = "(?is).*((?<!is|is_ )secret|(?<!un|un_|is|is_ )trusted).*" }
54
54
55
55
/**
56
56
* Gets a regular expression that identifies strings that may indicate the presence of
@@ -96,10 +96,14 @@ module HeuristicNames {
96
96
* Gets a regular expression that identifies strings that may indicate the presence of data
97
97
* that is hashed or encrypted, and hence rendered non-sensitive, or contains special characters
98
98
* suggesting nouns within the string do not represent the meaning of the whole string (e.g. a URL or a SQL query).
99
+ *
100
+ * We also filter out common words like `certain` and `concert`, since otherwise these could
101
+ * be matched by the certificate regular expressions. Same for `accountable` (account), or
102
+ * `secretarial` (secret).
99
103
*/
100
104
string notSensitiveRegexp ( ) {
101
105
result =
102
- "(?is).*([^\\w$.-]|redact|censor|obfuscate|hash|md5|sha|random|((?<!un)(en))?(crypt|code)).*"
106
+ "(?is).*([^\\w$.-]|redact|censor|obfuscate|hash|md5|sha|random|((?<!un)(en))?(crypt|code)|certain|concert|secretar|accountant|accountab ).*"
103
107
}
104
108
105
109
/**
You can’t perform that action at this time.
0 commit comments