Add live literals as sanitizers for sensitive logging

This commit is contained in:
Tony Torralba
2022-05-05 12:32:10 +02:00
parent 5db8306fef
commit f0a0ac100b
2 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import java
private import semmle.code.java.dataflow.ExternalFlow
import semmle.code.java.dataflow.TaintTracking
import semmle.code.java.security.SensitiveActions
import semmle.code.java.frameworks.android.Compose
import DataFlow
/** A variable that may hold sensitive information, judging by its name. */
@@ -23,4 +24,8 @@ class SensitiveLoggerConfiguration extends TaintTracking::Configuration {
override predicate isSource(DataFlow::Node source) { source.asExpr() instanceof CredentialExpr }
override predicate isSink(DataFlow::Node sink) { sinkNode(sink, "logging") }
override predicate isSanitizer(DataFlow::Node sanitizer) {
sanitizer.asExpr() instanceof LiveLiteral
}
}

View File

@@ -1,4 +1,7 @@
---
category: minorAnalysis
---
* 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.
* Query `java/sensitive-log` has received several improvements.
* It no longer considers usernames as sensitive information.
* The conditions to consider a variable a constant (and therefore exclude it as user-provided sensitive information) have been tightened.
* A sanitizer has been added to handle certain elements introduced by a Kotlin compiler plugin that have deceptive names.