mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #12578 from egregius313/egregius313/conform-dataflow-configs-to-config-naming-convention
Conform dataflow config modules to follow `*Config` naming convention
This commit is contained in:
@@ -63,7 +63,7 @@ class OnActivityResultIncomingIntent extends DataFlow::Node {
|
||||
/**
|
||||
* A data flow configuration for implicit intents being used in `startActivityForResult`.
|
||||
*/
|
||||
private module ImplicitStartActivityForResultConf implements DataFlow::ConfigSig {
|
||||
private module ImplicitStartActivityForResultConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) {
|
||||
exists(ClassInstanceExpr cc |
|
||||
cc.getConstructedType() instanceof TypeIntent and source.asExpr() = cc
|
||||
@@ -103,7 +103,8 @@ private module ImplicitStartActivityForResultConf implements DataFlow::ConfigSig
|
||||
}
|
||||
}
|
||||
|
||||
private module ImplicitStartActivityForResult = DataFlow::Make<ImplicitStartActivityForResultConf>;
|
||||
private module ImplicitStartActivityForResult =
|
||||
DataFlow::Make<ImplicitStartActivityForResultConfig>;
|
||||
|
||||
/** An Android Activity or Fragment. */
|
||||
private class ActivityOrFragment extends Class {
|
||||
|
||||
@@ -10,7 +10,7 @@ private class ParseAsMethod extends Method {
|
||||
}
|
||||
}
|
||||
|
||||
private module TypeLiteralToParseAsFlowConfiguration implements DataFlow::ConfigSig {
|
||||
private module TypeLiteralToParseAsFlowConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof TypeLiteral }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) {
|
||||
@@ -21,7 +21,7 @@ private module TypeLiteralToParseAsFlowConfiguration implements DataFlow::Config
|
||||
}
|
||||
}
|
||||
|
||||
private module TypeLiteralToParseAsFlow = DataFlow::Make<TypeLiteralToParseAsFlowConfiguration>;
|
||||
private module TypeLiteralToParseAsFlow = DataFlow::Make<TypeLiteralToParseAsFlowConfig>;
|
||||
|
||||
private TypeLiteral getSourceWithFlowToParseAs() {
|
||||
TypeLiteralToParseAsFlow::hasFlow(DataFlow::exprNode(result), _)
|
||||
|
||||
@@ -90,7 +90,7 @@ private class FieldReferencedJacksonSerializableType extends JacksonSerializable
|
||||
/** A type whose values may be deserialized by the Jackson JSON framework. */
|
||||
abstract class JacksonDeserializableType extends Type { }
|
||||
|
||||
private module TypeLiteralToJacksonDatabindFlowConfiguration implements DataFlow::ConfigSig {
|
||||
private module TypeLiteralToJacksonDatabindFlowConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof TypeLiteral }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) {
|
||||
@@ -108,7 +108,7 @@ private module TypeLiteralToJacksonDatabindFlowConfiguration implements DataFlow
|
||||
}
|
||||
|
||||
private module TypeLiteralToJacksonDatabindFlow =
|
||||
DataFlow::Make<TypeLiteralToJacksonDatabindFlowConfiguration>;
|
||||
DataFlow::Make<TypeLiteralToJacksonDatabindFlowConfig>;
|
||||
|
||||
private TypeLiteral getSourceWithFlowToJacksonDatabind() {
|
||||
TypeLiteralToJacksonDatabindFlow::hasFlow(DataFlow::exprNode(result), _)
|
||||
|
||||
@@ -9,7 +9,7 @@ private import semmle.code.java.security.ArbitraryApkInstallation
|
||||
* A dataflow configuration for flow from an external source of an APK to the
|
||||
* `setData[AndType][AndNormalize]` method of an intent.
|
||||
*/
|
||||
private module ApkInstallationConfiguration implements DataFlow::ConfigSig {
|
||||
private module ApkInstallationConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node node) { node instanceof ExternalApkSource }
|
||||
|
||||
predicate isSink(DataFlow::Node node) {
|
||||
@@ -25,7 +25,7 @@ private module ApkInstallationConfiguration implements DataFlow::ConfigSig {
|
||||
}
|
||||
}
|
||||
|
||||
module ApkInstallationFlow = DataFlow::Make<ApkInstallationConfiguration>;
|
||||
module ApkInstallationFlow = DataFlow::Make<ApkInstallationConfig>;
|
||||
|
||||
private newtype ActionState =
|
||||
ActionUnset() or
|
||||
@@ -37,7 +37,7 @@ private newtype ActionState =
|
||||
*
|
||||
* This is used to track if an intent is used to install an APK.
|
||||
*/
|
||||
private module InstallPackageActionConfiguration implements DataFlow::StateConfigSig {
|
||||
private module InstallPackageActionConfig implements DataFlow::StateConfigSig {
|
||||
class FlowState = ActionState;
|
||||
|
||||
predicate isSource(DataFlow::Node source, FlowState state) {
|
||||
@@ -72,8 +72,7 @@ private module InstallPackageActionConfiguration implements DataFlow::StateConfi
|
||||
predicate isBarrier(DataFlow::Node node, FlowState state) { none() }
|
||||
}
|
||||
|
||||
private module InstallPackageActionFlow =
|
||||
TaintTracking::MakeWithState<InstallPackageActionConfiguration>;
|
||||
private module InstallPackageActionFlow = TaintTracking::MakeWithState<InstallPackageActionConfig>;
|
||||
|
||||
private newtype MimeTypeState =
|
||||
MimeTypeUnset() or
|
||||
@@ -84,7 +83,7 @@ private newtype MimeTypeState =
|
||||
* the `setType` or `setTypeAndNormalize` method of an intent, followed by a call
|
||||
* to `setData[AndType][AndNormalize]`.
|
||||
*/
|
||||
private module PackageArchiveMimeTypeConfiguration implements DataFlow::StateConfigSig {
|
||||
private module PackageArchiveMimeTypeConfig implements DataFlow::StateConfigSig {
|
||||
class FlowState = MimeTypeState;
|
||||
|
||||
predicate isSource(DataFlow::Node node, FlowState state) {
|
||||
@@ -118,4 +117,4 @@ private module PackageArchiveMimeTypeConfiguration implements DataFlow::StateCon
|
||||
}
|
||||
|
||||
private module PackageArchiveMimeTypeFlow =
|
||||
TaintTracking::MakeWithState<PackageArchiveMimeTypeConfiguration>;
|
||||
TaintTracking::MakeWithState<PackageArchiveMimeTypeConfig>;
|
||||
|
||||
@@ -23,7 +23,7 @@ deprecated class FragmentInjectionTaintConf extends TaintTracking::Configuration
|
||||
}
|
||||
}
|
||||
|
||||
private module FragmentInjectionTaintConf implements DataFlow::ConfigSig {
|
||||
private module FragmentInjectionTaintConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof FragmentInjectionSink }
|
||||
@@ -37,4 +37,4 @@ private module FragmentInjectionTaintConf implements DataFlow::ConfigSig {
|
||||
* Taint-tracking flow for unsafe user input
|
||||
* that is used to create Android fragments dynamically.
|
||||
*/
|
||||
module FragmentInjectionTaintFlow = TaintTracking::Make<FragmentInjectionTaintConf>;
|
||||
module FragmentInjectionTaintFlow = TaintTracking::Make<FragmentInjectionTaintConfig>;
|
||||
|
||||
@@ -35,7 +35,7 @@ deprecated class IntentUriPermissionManipulationConf extends TaintTracking::Conf
|
||||
}
|
||||
}
|
||||
|
||||
private module IntentUriPermissionManipulationConf implements DataFlow::ConfigSig {
|
||||
private module IntentUriPermissionManipulationConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof IntentUriPermissionManipulationSink }
|
||||
@@ -53,4 +53,4 @@ private module IntentUriPermissionManipulationConf implements DataFlow::ConfigSi
|
||||
* Taint tracking flow for user-provided Intents being returned to third party apps.
|
||||
*/
|
||||
module IntentUriPermissionManipulationFlow =
|
||||
TaintTracking::Make<IntentUriPermissionManipulationConf>;
|
||||
TaintTracking::Make<IntentUriPermissionManipulationConfig>;
|
||||
|
||||
@@ -23,7 +23,7 @@ deprecated class LogInjectionConfiguration extends TaintTracking::Configuration
|
||||
}
|
||||
}
|
||||
|
||||
private module LogInjectionConfiguration implements DataFlow::ConfigSig {
|
||||
private module LogInjectionConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof LogInjectionSink }
|
||||
@@ -38,4 +38,4 @@ private module LogInjectionConfiguration implements DataFlow::ConfigSig {
|
||||
/**
|
||||
* Taint-tracking flow for tracking untrusted user input used in log entries.
|
||||
*/
|
||||
module LogInjectionFlow = TaintTracking::Make<LogInjectionConfiguration>;
|
||||
module LogInjectionFlow = TaintTracking::Make<LogInjectionConfig>;
|
||||
|
||||
@@ -35,7 +35,7 @@ deprecated class RequestForgeryConfiguration extends TaintTracking::Configuratio
|
||||
/**
|
||||
* A taint-tracking configuration characterising request-forgery risks.
|
||||
*/
|
||||
private module RequestForgeryConfiguration implements DataFlow::ConfigSig {
|
||||
private module RequestForgeryConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) {
|
||||
source instanceof RemoteFlowSource and
|
||||
// Exclude results of remote HTTP requests: fetching something else based on that result
|
||||
@@ -53,4 +53,4 @@ private module RequestForgeryConfiguration implements DataFlow::ConfigSig {
|
||||
predicate isBarrier(DataFlow::Node node) { node instanceof RequestForgerySanitizer }
|
||||
}
|
||||
|
||||
module RequestForgeryFlow = TaintTracking::Make<RequestForgeryConfiguration>;
|
||||
module RequestForgeryFlow = TaintTracking::Make<RequestForgeryConfig>;
|
||||
|
||||
@@ -49,7 +49,7 @@ deprecated class SensitiveLoggerConfiguration extends TaintTracking::Configurati
|
||||
}
|
||||
|
||||
/** A data-flow configuration for identifying potentially-sensitive data flowing to a log output. */
|
||||
private module SensitiveLoggerConfiguration implements DataFlow::ConfigSig {
|
||||
private module SensitiveLoggerConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof CredentialExpr }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sinkNode(sink, "logging") }
|
||||
@@ -65,4 +65,4 @@ private module SensitiveLoggerConfiguration implements DataFlow::ConfigSig {
|
||||
predicate isBarrierIn(Node node) { isSource(node) }
|
||||
}
|
||||
|
||||
module SensitiveLoggerFlow = TaintTracking::Make<SensitiveLoggerConfiguration>;
|
||||
module SensitiveLoggerFlow = TaintTracking::Make<SensitiveLoggerConfig>;
|
||||
|
||||
@@ -26,7 +26,7 @@ deprecated class UnsafeContentResolutionConf extends TaintTracking::Configuratio
|
||||
}
|
||||
}
|
||||
|
||||
private module UnsafeContentResolutionConf implements DataFlow::ConfigSig {
|
||||
private module UnsafeContentResolutionConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof ContentUriResolutionSink }
|
||||
@@ -41,4 +41,4 @@ private module UnsafeContentResolutionConf implements DataFlow::ConfigSig {
|
||||
}
|
||||
|
||||
/** Taint-tracking flow to find paths from remote sources to content URI resolutions. */
|
||||
module UnsafeContentResolutionFlow = TaintTracking::Make<UnsafeContentResolutionConf>;
|
||||
module UnsafeContentResolutionFlow = TaintTracking::Make<UnsafeContentResolutionConfig>;
|
||||
|
||||
@@ -28,7 +28,7 @@ class BrokenAlgoLiteral extends ShortStringLiteral {
|
||||
}
|
||||
}
|
||||
|
||||
module InsecureCryptoConfiguration implements ConfigSig {
|
||||
module InsecureCryptoConfig implements ConfigSig {
|
||||
predicate isSource(Node n) { n.asExpr() instanceof BrokenAlgoLiteral }
|
||||
|
||||
predicate isSink(Node n) { exists(CryptoAlgoSpec c | n.asExpr() = c.getAlgoSpec()) }
|
||||
@@ -38,7 +38,7 @@ module InsecureCryptoConfiguration implements ConfigSig {
|
||||
}
|
||||
}
|
||||
|
||||
module InsecureCryptoFlow = TaintTracking::Make<InsecureCryptoConfiguration>;
|
||||
module InsecureCryptoFlow = TaintTracking::Make<InsecureCryptoConfig>;
|
||||
|
||||
import InsecureCryptoFlow::PathGraph
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class StringContainer extends RefType {
|
||||
}
|
||||
}
|
||||
|
||||
module InsecureCryptoConfiguration implements ConfigSig {
|
||||
module InsecureCryptoConfig implements ConfigSig {
|
||||
predicate isSource(Node n) { n.asExpr() instanceof InsecureAlgoLiteral }
|
||||
|
||||
predicate isSink(Node n) { exists(CryptoAlgoSpec c | n.asExpr() = c.getAlgoSpec()) }
|
||||
@@ -61,7 +61,7 @@ module InsecureCryptoConfiguration implements ConfigSig {
|
||||
}
|
||||
}
|
||||
|
||||
module InsecureCryptoFlow = TaintTracking::Make<InsecureCryptoConfiguration>;
|
||||
module InsecureCryptoFlow = TaintTracking::Make<InsecureCryptoConfig>;
|
||||
|
||||
import InsecureCryptoFlow::PathGraph
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ private predicate defaultSource(DataFlow::Node src) {
|
||||
src.asExpr().(MethodAccess).getMethod().getName() = ["source", "taint"]
|
||||
}
|
||||
|
||||
module DefaultFlowConf implements DataFlow::ConfigSig {
|
||||
module DefaultFlowConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node n) { defaultSource(n) }
|
||||
|
||||
predicate isSink(DataFlow::Node n) {
|
||||
@@ -57,9 +57,9 @@ module DefaultFlowConf implements DataFlow::ConfigSig {
|
||||
int fieldFlowBranchLimit() { result = 1000 }
|
||||
}
|
||||
|
||||
private module DefaultValueFlow = DataFlow::Make<DefaultFlowConf>;
|
||||
private module DefaultValueFlow = DataFlow::Make<DefaultFlowConfig>;
|
||||
|
||||
private module DefaultTaintFlow = TaintTracking::Make<DefaultFlowConf>;
|
||||
private module DefaultTaintFlow = TaintTracking::Make<DefaultFlowConfig>;
|
||||
|
||||
class DefaultValueFlowConf extends DataFlow::Configuration {
|
||||
DefaultValueFlowConf() { this = "qltest:defaultValueFlowConf" }
|
||||
|
||||
@@ -39,7 +39,7 @@ predicate step(Node n1, Node n2, string s1, string s2) {
|
||||
|
||||
predicate checkNode(Node n) { n.asExpr().(Argument).getCall().getCallee().hasName("check") }
|
||||
|
||||
module Conf implements DataFlow::StateConfigSig {
|
||||
module Config implements DataFlow::StateConfigSig {
|
||||
class FlowState = string;
|
||||
|
||||
predicate isSource(Node n, FlowState s) { src(n, s) }
|
||||
@@ -55,7 +55,7 @@ module Conf implements DataFlow::StateConfigSig {
|
||||
|
||||
int explorationLimit() { result = 0 }
|
||||
|
||||
module Flow = TaintTracking::MakeWithState<Conf>;
|
||||
module Flow = TaintTracking::MakeWithState<Config>;
|
||||
|
||||
module PartialFlow = Flow::FlowExploration<explorationLimit/0>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user