mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Optimize the query
This commit is contained in:
@@ -35,7 +35,7 @@ private predicate sharedPreferencesStore(DataFlow::Node sharedPrefs, Expr store)
|
||||
}
|
||||
|
||||
/** Flow from `SharedPreferences` to either a setter or a store method. */
|
||||
class SharedPreferencesFlowConfig extends TaintTracking::Configuration {
|
||||
class SharedPreferencesFlowConfig extends DataFlow::Configuration {
|
||||
SharedPreferencesFlowConfig() {
|
||||
this = "CleartextStorageSharedPrefs::SharedPreferencesFlowConfig"
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class EncryptedValueFlowConfig extends DataFlow5::Configuration {
|
||||
EncryptedValueFlowConfig() { this = "CleartextStorageSharedPrefs::EncryptedValueFlowConfig" }
|
||||
|
||||
override predicate isSource(DataFlow5::Node src) {
|
||||
exists(EncryptedSensitiveMethodAccess ema | src.asExpr() = ema.getAnArgument())
|
||||
exists(EncryptedSensitiveMethodAccess ema | src.asExpr() = ema)
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow5::Node sink) {
|
||||
@@ -74,13 +74,6 @@ class EncryptedValueFlowConfig extends DataFlow5::Configuration {
|
||||
sink.asExpr() = ma.getArgument(1)
|
||||
)
|
||||
}
|
||||
|
||||
override predicate isAdditionalFlowStep(DataFlow5::Node n1, DataFlow5::Node n2) {
|
||||
exists(EncryptedSensitiveMethodAccess ema |
|
||||
n1.asExpr() = ema.getAnArgument() and
|
||||
n2.asExpr() = ema
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** Flow from the create method of `androidx.security.crypto.EncryptedSharedPreferences` to its instance. */
|
||||
@@ -109,7 +102,7 @@ class SharedPreferencesEditor extends MethodAccess {
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets an input, for example `input` in `editor.putString("password", password);`. */
|
||||
/** Gets an input, for example `password` in `editor.putString("password", password);`. */
|
||||
Expr getAnInput() {
|
||||
exists(SharedPreferencesFlowConfig conf, DataFlow::Node n |
|
||||
sharedPreferencesInput(n, result) and
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import semmle.code.java.Type
|
||||
/** Provides classes related to `android.content.SharedPreferences`. */
|
||||
|
||||
import java
|
||||
|
||||
/** Definitions related to `android.content.SharedPreferences`. */
|
||||
module SharedPreferences {
|
||||
|
||||
Reference in New Issue
Block a user