Skip to content

Commit f0a0ac1

Browse files
committed
Add live literals as sanitizers for sensitive logging
1 parent 5db8306 commit f0a0ac1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

java/ql/lib/semmle/code/java/security/SensitiveLoggingQuery.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import java
44
private import semmle.code.java.dataflow.ExternalFlow
55
import semmle.code.java.dataflow.TaintTracking
66
import semmle.code.java.security.SensitiveActions
7+
import semmle.code.java.frameworks.android.Compose
78
import DataFlow
89

910
/** A variable that may hold sensitive information, judging by its name. */
@@ -23,4 +24,8 @@ class SensitiveLoggerConfiguration extends TaintTracking::Configuration {
2324
override predicate isSource(DataFlow::Node source) { source.asExpr() instanceof CredentialExpr }
2425

2526
override predicate isSink(DataFlow::Node sink) { sinkNode(sink, "logging") }
27+
28+
override predicate isSanitizer(DataFlow::Node sanitizer) {
29+
sanitizer.asExpr() instanceof LiveLiteral
30+
}
2631
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
22
category: minorAnalysis
33
---
4-
* Query `java/sensitive-log` no longer considers usernames as sensitive information. Also, the conditions to consider a variable a constant (and therefore exclude it as user-provided sensitive information) have been tightened.
4+
* Query `java/sensitive-log` has received several improvements.
5+
* It no longer considers usernames as sensitive information.
6+
* The conditions to consider a variable a constant (and therefore exclude it as user-provided sensitive information) have been tightened.
7+
* A sanitizer has been added to handle certain elements introduced by a Kotlin compiler plugin that have deceptive names.

0 commit comments

Comments
 (0)