Skip to content

Commit ffd442a

Browse files
authored
Fine tuning criteria
1. Change the regex pattern from variable contains "url" to variable starts with "url" 2. Add the logging trace method to sink
1 parent 491b67e commit ffd442a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/src/experimental/CWE-532/SensitiveInfoLog.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import PathGraph
1717
*/
1818
private string getACredentialRegex() {
1919
result = "(?i).*pass(wd|word|code|phrase)(?!.*question).*" or
20-
result = "(?i).*(username|url).*"
20+
result = "(?i)(.*username|url).*"
2121
}
2222

2323
/** The variable or concatenated string with the variable that keeps sensitive information judging by its name * */
@@ -42,7 +42,7 @@ class LoggerType extends RefType {
4242
predicate isSensitiveLoggingSink(DataFlow::Node sink) {
4343
exists(MethodAccess ma |
4444
ma.getMethod().getDeclaringType() instanceof LoggerType and
45-
ma.getMethod().hasName("debug") and
45+
(ma.getMethod().hasName("debug") or ma.getMethod().hasName("trace")) and
4646
sink.asExpr() = ma.getAnArgument()
4747
)
4848
}

0 commit comments

Comments
 (0)