Skip to content

Commit 9affa15

Browse files
committed
Add Log4J 2 and a new search string secret
1 parent 7265e94 commit 9affa15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

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

2323
/** Variable keeps sensitive information judging by its name * */
@@ -31,6 +31,7 @@ class CredentialExpr extends Expr {
3131
class LoggerType extends RefType {
3232
LoggerType() {
3333
this.hasQualifiedName("org.apache.log4j", "Category") or //Log4J
34+
this.hasQualifiedName("org.apache.logging.log4j", "Logger") or //Log4J 2
3435
this.hasQualifiedName("org.slf4j", "Logger") or //SLF4j and Gradle Logging
3536
this.hasQualifiedName("org.jboss.logging", "BasicLogger") //JBoss Logging
3637
}

0 commit comments

Comments
 (0)