зеркало из https://github.com/github/codeql.git
mass rename to ActiveThreatModelSource
This commit is contained in:
Родитель
038bc832a7
Коммит
8c10155eb7
|
@ -18,7 +18,7 @@ private predicate needsChecks(ActionMethod m) { m.isEdit() and not m.isAdmin() }
|
||||||
* that may indicate that it's used as the ID for some resource
|
* that may indicate that it's used as the ID for some resource
|
||||||
*/
|
*/
|
||||||
private predicate hasIdParameter(ActionMethod m) {
|
private predicate hasIdParameter(ActionMethod m) {
|
||||||
exists(ThreatModelFlowSource src | src.getEnclosingCallable() = m |
|
exists(ActiveThreatModelSource src | src.getEnclosingCallable() = m |
|
||||||
src.asParameter().getName().toLowerCase().matches(["%id", "%idx"])
|
src.asParameter().getName().toLowerCase().matches(["%id", "%idx"])
|
||||||
or
|
or
|
||||||
// handle cases like `Request.QueryString["Id"]`
|
// handle cases like `Request.QueryString["Id"]`
|
||||||
|
|
|
@ -55,7 +55,7 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
|
||||||
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
|
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
private class SimpleTypeSanitizer extends Sanitizer, SimpleTypeSanitizedExpr { }
|
private class SimpleTypeSanitizer extends Sanitizer, SimpleTypeSanitizedExpr { }
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ module CommandInjection = TaintTracking::Global<CommandInjectionConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** Command Injection sinks defined through Models as Data. */
|
/** Command Injection sinks defined through Models as Data. */
|
||||||
private class ExternalCommandInjectionExprSink extends Sink {
|
private class ExternalCommandInjectionExprSink extends Sink {
|
||||||
|
|
|
@ -54,7 +54,7 @@ module ConditionalBypass = TaintTracking::Global<ConditionalBypassConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** The result of a reverse dns may be user-controlled. */
|
/** The result of a reverse dns may be user-controlled. */
|
||||||
class ReverseDnsSource extends Source {
|
class ReverseDnsSource extends Source {
|
||||||
|
|
|
@ -73,14 +73,14 @@ class ExternalApiDataNode extends DataFlow::Node {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A configuration for tracking flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s. */
|
/** A configuration for tracking flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s. */
|
||||||
private module RemoteSourceToExternalApiConfig implements DataFlow::ConfigSig {
|
private module RemoteSourceToExternalApiConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
|
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A module for tracking flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s. */
|
/** A module for tracking flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s. */
|
||||||
module RemoteSourceToExternalApi = TaintTracking::Global<RemoteSourceToExternalApiConfig>;
|
module RemoteSourceToExternalApi = TaintTracking::Global<RemoteSourceToExternalApiConfig>;
|
||||||
|
|
||||||
/** A node representing untrusted data being passed to an external API. */
|
/** A node representing untrusted data being passed to an external API. */
|
||||||
|
|
|
@ -60,7 +60,7 @@ module LdapInjection = TaintTracking::Global<LdapInjectionConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** LDAP sinks defined through Models as Data. */
|
/** LDAP sinks defined through Models as Data. */
|
||||||
private class ExternalLdapExprSink extends Sink {
|
private class ExternalLdapExprSink extends Sink {
|
||||||
|
|
|
@ -43,7 +43,7 @@ private module LogForgingConfig implements DataFlow::ConfigSig {
|
||||||
module LogForging = TaintTracking::Global<LogForgingConfig>;
|
module LogForging = TaintTracking::Global<LogForgingConfig>;
|
||||||
|
|
||||||
/** A source of remote user input. */
|
/** A source of remote user input. */
|
||||||
private class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
private class HtmlSanitizer extends Sanitizer {
|
private class HtmlSanitizer extends Sanitizer {
|
||||||
HtmlSanitizer() { this.asExpr() instanceof HtmlSanitizedExpr }
|
HtmlSanitizer() { this.asExpr() instanceof HtmlSanitizedExpr }
|
||||||
|
|
|
@ -48,7 +48,7 @@ private module MissingXmlValidationConfig implements DataFlow::ConfigSig {
|
||||||
module MissingXmlValidation = TaintTracking::Global<MissingXmlValidationConfig>;
|
module MissingXmlValidation = TaintTracking::Global<MissingXmlValidationConfig>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` instead.
|
||||||
*
|
*
|
||||||
* A source of remote user input.
|
* A source of remote user input.
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +57,7 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
|
||||||
/**
|
/**
|
||||||
* A source supported by the current threat model.
|
* A source supported by the current threat model.
|
||||||
*/
|
*/
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input argument to a call to `XmlReader.Create` where the input will not be validated against
|
* The input argument to a call to `XmlReader.Create` where the input will not be validated against
|
||||||
|
|
|
@ -49,7 +49,7 @@ module ReDoS = TaintTracking::Global<ReDoSConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An expression that represents a regular expression with potential exponential behavior.
|
* An expression that represents a regular expression with potential exponential behavior.
|
||||||
|
|
|
@ -48,7 +48,7 @@ module RegexInjection = TaintTracking::Global<RegexInjectionConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A `pattern` argument to a construction of a `Regex`.
|
* A `pattern` argument to a construction of a `Regex`.
|
||||||
|
|
|
@ -54,7 +54,7 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
|
||||||
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
|
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** An argument to the `ConnectionString` property on a data connection class. */
|
/** An argument to the `ConnectionString` property on a data connection class. */
|
||||||
class SqlConnectionStringSink extends Sink {
|
class SqlConnectionStringSink extends Sink {
|
||||||
|
|
|
@ -65,7 +65,7 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
|
||||||
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
|
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** An SQL expression passed to an API call that executes SQL. */
|
/** An SQL expression passed to an API call that executes SQL. */
|
||||||
class SqlInjectionExprSink extends Sink {
|
class SqlInjectionExprSink extends Sink {
|
||||||
|
|
|
@ -50,7 +50,7 @@ module TaintedPath = TaintTracking::Global<TaintedPathConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A path argument to a `File` method call.
|
* A path argument to a `File` method call.
|
||||||
|
|
|
@ -49,7 +49,7 @@ abstract private class ConstructorOrStaticMethodSink extends Sink { }
|
||||||
*/
|
*/
|
||||||
abstract class Sanitizer extends DataFlow::Node { }
|
abstract class Sanitizer extends DataFlow::Node { }
|
||||||
|
|
||||||
private class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User input to object method call deserialization flow tracking configuration.
|
* User input to object method call deserialization flow tracking configuration.
|
||||||
|
|
|
@ -52,7 +52,7 @@ module UrlRedirect = TaintTracking::Global<UrlRedirectConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** URL Redirection sinks defined through Models as Data. */
|
/** URL Redirection sinks defined through Models as Data. */
|
||||||
private class ExternalUrlRedirectExprSink extends Sink {
|
private class ExternalUrlRedirectExprSink extends Sink {
|
||||||
|
|
|
@ -15,7 +15,7 @@ private import semmle.code.csharp.security.Sanitizers
|
||||||
*/
|
*/
|
||||||
abstract class Source extends DataFlow::Node { }
|
abstract class Source extends DataFlow::Node { }
|
||||||
|
|
||||||
private class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A data flow sink for untrusted user input used in XML processing.
|
* A data flow sink for untrusted user input used in XML processing.
|
||||||
|
|
|
@ -58,7 +58,7 @@ module XpathInjection = TaintTracking::Global<XpathInjectionConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** The `xpath` argument to an `XPathExpression.Compile(..)` call. */
|
/** The `xpath` argument to an `XPathExpression.Compile(..)` call. */
|
||||||
class XPathExpressionCompileSink extends Sink {
|
class XPathExpressionCompileSink extends Sink {
|
||||||
|
|
|
@ -165,7 +165,7 @@ module XssTrackingConfig implements DataFlow::ConfigSig {
|
||||||
module XssTracking = TaintTracking::Global<XssTrackingConfig>;
|
module XssTracking = TaintTracking::Global<XssTrackingConfig>;
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
private class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
private class SimpleTypeSanitizer extends Sanitizer, SimpleTypeSanitizedExpr { }
|
private class SimpleTypeSanitizer extends Sanitizer, SimpleTypeSanitizedExpr { }
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import XmlInjection::PathGraph
|
||||||
* A taint-tracking configuration for untrusted user input used in XML.
|
* A taint-tracking configuration for untrusted user input used in XML.
|
||||||
*/
|
*/
|
||||||
module XmlInjectionConfig implements DataFlow::ConfigSig {
|
module XmlInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(MethodCall mc |
|
exists(MethodCall mc |
|
||||||
|
|
|
@ -21,7 +21,7 @@ import AssemblyPathInjection::PathGraph
|
||||||
* A taint-tracking configuration for untrusted user input used to load a DLL.
|
* A taint-tracking configuration for untrusted user input used to load a DLL.
|
||||||
*/
|
*/
|
||||||
module AssemblyPathInjectionConfig implements DataFlow::ConfigSig {
|
module AssemblyPathInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(MethodCall mc, string name, int arg |
|
exists(MethodCall mc, string name, int arg |
|
||||||
|
|
|
@ -17,7 +17,7 @@ import semmle.code.csharp.frameworks.Format
|
||||||
import FormatString::PathGraph
|
import FormatString::PathGraph
|
||||||
|
|
||||||
module FormatStringConfig implements DataFlow::ConfigSig {
|
module FormatStringConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
sink.asExpr() = any(FormatCall call | call.hasInsertions()).getFormatExpr()
|
sink.asExpr() = any(FormatCall call | call.hasInsertions()).getFormatExpr()
|
||||||
|
|
|
@ -61,7 +61,7 @@ module TaintedWebClient = TaintTracking::Global<TaintedWebClientConfig>;
|
||||||
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
|
||||||
|
|
||||||
/** A source supported by the current threat model. */
|
/** A source supported by the current threat model. */
|
||||||
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A path argument to a `WebClient` method call that has an address argument.
|
* A path argument to a `WebClient` method call that has an address argument.
|
||||||
|
|
|
@ -60,7 +60,7 @@ module RequestForgery {
|
||||||
/**
|
/**
|
||||||
* A dataflow source for Server Side Request Forgery(SSRF) Vulnerabilities.
|
* A dataflow source for Server Side Request Forgery(SSRF) Vulnerabilities.
|
||||||
*/
|
*/
|
||||||
private class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An url argument to a `HttpRequestMessage` constructor call
|
* An url argument to a `HttpRequestMessage` constructor call
|
||||||
|
|
|
@ -2,5 +2,5 @@ import csharp
|
||||||
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
||||||
|
|
||||||
from DataFlow::Node source
|
from DataFlow::Node source
|
||||||
where source instanceof ThreatModelFlowSource
|
where source instanceof ActiveThreatModelSource
|
||||||
select source
|
select source
|
||||||
|
|
|
@ -2,7 +2,7 @@ import csharp
|
||||||
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
||||||
|
|
||||||
module CommandLineFlowConfig implements DataFlow::ConfigSig {
|
module CommandLineFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(MethodCall mc | mc.getTarget().hasName("Sink") | sink.asExpr() = mc.getArgument(0))
|
exists(MethodCall mc | mc.getTarget().hasName("Sink") | sink.asExpr() = mc.getArgument(0))
|
||||||
|
|
|
@ -2,5 +2,5 @@ import csharp
|
||||||
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
||||||
|
|
||||||
from DataFlow::Node source
|
from DataFlow::Node source
|
||||||
where source instanceof ThreatModelFlowSource
|
where source instanceof ActiveThreatModelSource
|
||||||
select source, source.(SourceNode).getThreatModel()
|
select source, source.(SourceNode).getThreatModel()
|
||||||
|
|
|
@ -4,7 +4,7 @@ import TestUtilities.InlineFlowTest
|
||||||
import TaintFlowTest<DatabaseConfig>
|
import TaintFlowTest<DatabaseConfig>
|
||||||
|
|
||||||
module DatabaseConfig implements DataFlow::ConfigSig {
|
module DatabaseConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(MethodCall mc | mc.getTarget().hasName("Sink") | sink.asExpr() = mc.getArgument(0))
|
exists(MethodCall mc | mc.getTarget().hasName("Sink") | sink.asExpr() = mc.getArgument(0))
|
||||||
|
|
|
@ -4,7 +4,7 @@ import TestUtilities.InlineFlowTest
|
||||||
import TaintFlowTest<FilesConfig>
|
import TaintFlowTest<FilesConfig>
|
||||||
|
|
||||||
module FilesConfig implements DataFlow::ConfigSig {
|
module FilesConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(MethodCall mc | mc.getTarget().hasName("Sink") | sink.asExpr() = mc.getArgument(0))
|
exists(MethodCall mc | mc.getTarget().hasName("Sink") | sink.asExpr() = mc.getArgument(0))
|
||||||
|
|
|
@ -4,7 +4,7 @@ private import semmle.code.csharp.dataflow.internal.ExternalFlow
|
||||||
private import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
private import semmle.code.csharp.security.dataflow.flowsources.FlowSources
|
||||||
|
|
||||||
private module ThreatModelConfig implements DataFlow::ConfigSig {
|
private module ThreatModelConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sinkNode(sink, _) }
|
predicate isSink(DataFlow::Node sink) { sinkNode(sink, _) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,12 +31,12 @@ module CommandInjection {
|
||||||
abstract class Sanitizer extends DataFlow::Node { }
|
abstract class Sanitizer extends DataFlow::Node { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/** A source of untrusted data, considered as a taint source for command injection. */
|
/** A source of untrusted data, considered as a taint source for command injection. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** A command name, considered as a taint sink for command injection. */
|
/** A command name, considered as a taint sink for command injection. */
|
||||||
class CommandNameAsSink extends Sink {
|
class CommandNameAsSink extends Sink {
|
||||||
|
|
|
@ -183,24 +183,24 @@ class UnknownExternalApiDataNode extends ExternalApiDataNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
private module UntrustedDataConfig implements DataFlow::ConfigSig {
|
private module UntrustedDataConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
|
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks data flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s.
|
* Tracks data flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s.
|
||||||
*/
|
*/
|
||||||
module UntrustedDataToExternalApiFlow = DataFlow::Global<UntrustedDataConfig>;
|
module UntrustedDataToExternalApiFlow = DataFlow::Global<UntrustedDataConfig>;
|
||||||
|
|
||||||
private module UntrustedDataToUnknownExternalApiConfig implements DataFlow::ConfigSig {
|
private module UntrustedDataToUnknownExternalApiConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof UnknownExternalApiDataNode }
|
predicate isSink(DataFlow::Node sink) { sink instanceof UnknownExternalApiDataNode }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks data flow from `ThreatModelFlowSource`s to `UnknownExternalApiDataNode`s.
|
* Tracks data flow from `ActiveThreatModelSource`s to `UnknownExternalApiDataNode`s.
|
||||||
*/
|
*/
|
||||||
module UntrustedDataToUnknownExternalApiFlow =
|
module UntrustedDataToUnknownExternalApiFlow =
|
||||||
DataFlow::Global<UntrustedDataToUnknownExternalApiConfig>;
|
DataFlow::Global<UntrustedDataToUnknownExternalApiConfig>;
|
||||||
|
|
|
@ -26,12 +26,12 @@ module LogInjection {
|
||||||
abstract class Sanitizer extends DataFlow::Node { }
|
abstract class Sanitizer extends DataFlow::Node { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/** A source of untrusted data, considered as a taint source for log injection. */
|
/** A source of untrusted data, considered as a taint source for log injection. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** An argument to a logging mechanism. */
|
/** An argument to a logging mechanism. */
|
||||||
class LoggerSink extends Sink {
|
class LoggerSink extends Sink {
|
||||||
|
|
|
@ -49,7 +49,7 @@ module MissingJwtSignatureCheck {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DefaultSource extends Source instanceof ThreatModelFlowSource { }
|
private class DefaultSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
private class DefaultSink extends Sink {
|
private class DefaultSink extends Sink {
|
||||||
DefaultSink() { sinkNode(this, "jwt") }
|
DefaultSink() { sinkNode(this, "jwt") }
|
||||||
|
|
|
@ -43,14 +43,14 @@ module OpenUrlRedirect {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A source of third-party user input, considered as a flow source for URL redirects.
|
* A source of third-party user input, considered as a flow source for URL redirects.
|
||||||
*/
|
*/
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource {
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource {
|
||||||
ThreatModelFlowAsSource() {
|
ThreatModelFlowAsSource() {
|
||||||
// exclude some fields and methods of URLs that are generally not attacker-controllable for
|
// exclude some fields and methods of URLs that are generally not attacker-controllable for
|
||||||
// open redirect exploits
|
// open redirect exploits
|
||||||
|
|
|
@ -35,14 +35,14 @@ module ReflectedXss {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A third-party controllable input, considered as a flow source for reflected XSS.
|
* A third-party controllable input, considered as a flow source for reflected XSS.
|
||||||
*/
|
*/
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** An arbitrary XSS sink, considered as a flow sink for stored XSS. */
|
/** An arbitrary XSS sink, considered as a flow sink for stored XSS. */
|
||||||
private class AnySink extends Sink instanceof SharedXss::Sink { }
|
private class AnySink extends Sink instanceof SharedXss::Sink { }
|
||||||
|
|
|
@ -34,14 +34,14 @@ module RequestForgery {
|
||||||
abstract class SanitizerEdge extends DataFlow::Node { }
|
abstract class SanitizerEdge extends DataFlow::Node { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A third-party controllable input, considered as a flow source for request forgery.
|
* A third-party controllable input, considered as a flow source for request forgery.
|
||||||
*/
|
*/
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
private class DefaultRequestForgerySink extends Sink {
|
private class DefaultRequestForgerySink extends Sink {
|
||||||
string kind;
|
string kind;
|
||||||
|
|
|
@ -26,12 +26,12 @@ module SqlInjection {
|
||||||
abstract class Sanitizer extends DataFlow::Node { }
|
abstract class Sanitizer extends DataFlow::Node { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/** A source of untrusted data, considered as a taint source for SQL injection. */
|
/** A source of untrusted data, considered as a taint source for SQL injection. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** An SQL string, considered as a taint sink for SQL injection. */
|
/** An SQL string, considered as a taint sink for SQL injection. */
|
||||||
class SqlQueryAsSink extends Sink instanceof SQL::QueryString { }
|
class SqlQueryAsSink extends Sink instanceof SQL::QueryString { }
|
||||||
|
|
|
@ -45,12 +45,12 @@ module TaintedPath {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/** A source of untrusted data, considered as a taint source for path traversal. */
|
/** A source of untrusted data, considered as a taint source for path traversal. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** A path expression, considered as a taint sink for path traversal. */
|
/** A path expression, considered as a taint sink for path traversal. */
|
||||||
class PathAsSink extends Sink {
|
class PathAsSink extends Sink {
|
||||||
|
|
|
@ -21,7 +21,7 @@ module UncontrolledAllocationSize {
|
||||||
abstract class Sanitizer extends DataFlow::Node { }
|
abstract class Sanitizer extends DataFlow::Node { }
|
||||||
|
|
||||||
/** A source of untrusted data, considered as a taint source for uncontrolled size allocation vulnerabilities. */
|
/** A source of untrusted data, considered as a taint source for uncontrolled size allocation vulnerabilities. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** The size argument of a memory allocation function. */
|
/** The size argument of a memory allocation function. */
|
||||||
private class AllocationSizeAsSink extends Sink instanceof AllocationSizeOverflow::AllocationSize {
|
private class AllocationSizeAsSink extends Sink instanceof AllocationSizeOverflow::AllocationSize {
|
||||||
|
|
|
@ -25,12 +25,12 @@ module XPathInjection {
|
||||||
abstract class Sanitizer extends DataFlow::ExprNode { }
|
abstract class Sanitizer extends DataFlow::ExprNode { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/** A source of untrusted data, used in an XPath expression. */
|
/** A source of untrusted data, used in an XPath expression. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/** An XPath expression string, considered as a taint sink for XPath injection. */
|
/** An XPath expression string, considered as a taint sink for XPath injection. */
|
||||||
class XPathExpressionStringAsSink extends Sink instanceof XPath::XPathExpressionString { }
|
class XPathExpressionStringAsSink extends Sink instanceof XPath::XPathExpressionString { }
|
||||||
|
|
|
@ -17,12 +17,12 @@ module EmailInjection {
|
||||||
abstract class Sink extends DataFlow::Node { }
|
abstract class Sink extends DataFlow::Node { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowSourceAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowSourceAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/** A source of untrusted data, considered as a taint source for email injection. */
|
/** A source of untrusted data, considered as a taint source for email injection. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A data-flow node that becomes part of an email considered as a taint sink for email injection.
|
* A data-flow node that becomes part of an email considered as a taint sink for email injection.
|
||||||
|
|
|
@ -98,13 +98,15 @@ private class LdapClientDNSink extends LdapSink {
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `LdapInjectionFlow` instead.
|
* DEPRECATED: Use `LdapInjectionFlow` instead.
|
||||||
*
|
*
|
||||||
* A taint-tracking configuration for reasoning about when a `ThreatModelFlowSource`
|
* A taint-tracking configuration for reasoning about when a `ActiveThreatModelSource`
|
||||||
* flows into an argument or field that is vulnerable to LDAP injection.
|
* flows into an argument or field that is vulnerable to LDAP injection.
|
||||||
*/
|
*/
|
||||||
deprecated class LdapInjectionConfiguration extends TaintTracking::Configuration {
|
deprecated class LdapInjectionConfiguration extends TaintTracking::Configuration {
|
||||||
LdapInjectionConfiguration() { this = "Ldap injection" }
|
LdapInjectionConfiguration() { this = "Ldap injection" }
|
||||||
|
|
||||||
override predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
override predicate isSource(DataFlow::Node source) {
|
||||||
|
source instanceof ActiveThreatModelSource
|
||||||
|
}
|
||||||
|
|
||||||
override predicate isSink(DataFlow::Node sink) { sink instanceof LdapSink }
|
override predicate isSink(DataFlow::Node sink) { sink instanceof LdapSink }
|
||||||
|
|
||||||
|
@ -112,7 +114,7 @@ deprecated class LdapInjectionConfiguration extends TaintTracking::Configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
private module LdapInjectionConfig implements DataFlow::ConfigSig {
|
private module LdapInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof LdapSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof LdapSink }
|
||||||
|
|
||||||
|
@ -120,7 +122,7 @@ private module LdapInjectionConfig implements DataFlow::ConfigSig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks taint flow for reasoning about when a `ThreatModelFlowSource` flows
|
* Tracks taint flow for reasoning about when a `ActiveThreatModelSource` flows
|
||||||
* into an argument or field that is vulnerable to LDAP injection.
|
* into an argument or field that is vulnerable to LDAP injection.
|
||||||
*/
|
*/
|
||||||
module LdapInjectionFlow = TaintTracking::Global<LdapInjectionConfig>;
|
module LdapInjectionFlow = TaintTracking::Global<LdapInjectionConfig>;
|
||||||
|
|
|
@ -98,7 +98,7 @@ private class SensitiveStringSink extends Sink {
|
||||||
|
|
||||||
module Config implements DataFlow::ConfigSig {
|
module Config implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource and not isBadResult(source)
|
source instanceof ActiveThreatModelSource and not isBadResult(source)
|
||||||
}
|
}
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof Sink and not isBadResult(sink) }
|
predicate isSink(DataFlow::Node sink) { sink instanceof Sink and not isBadResult(sink) }
|
||||||
|
|
|
@ -68,7 +68,7 @@ module ImproperLdapAuth {
|
||||||
|
|
||||||
private module Config implements DataFlow::ConfigSig {
|
private module Config implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource or source instanceof EmptyString
|
source instanceof ActiveThreatModelSource or source instanceof EmptyString
|
||||||
}
|
}
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof LdapAuthSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof LdapAuthSink }
|
||||||
|
|
|
@ -28,7 +28,7 @@ predicate divideByZeroSanitizerGuard(DataFlow::Node g, Expr e, boolean branch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module Config implements DataFlow::ConfigSig {
|
module Config implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
|
predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
|
||||||
exists(Function f, DataFlow::CallNode cn | cn = f.getACall() |
|
exists(Function f, DataFlow::CallNode cn | cn = f.getACall() |
|
||||||
|
|
|
@ -14,7 +14,7 @@ import DsnInjectionCustomizations
|
||||||
import DsnInjectionFlow::PathGraph
|
import DsnInjectionFlow::PathGraph
|
||||||
|
|
||||||
/** A remote flow source taken as a source for the `DsnInjection` taint-flow configuration. */
|
/** A remote flow source taken as a source for the `DsnInjection` taint-flow configuration. */
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
from DsnInjectionFlow::PathNode source, DsnInjectionFlow::PathNode sink
|
from DsnInjectionFlow::PathNode source, DsnInjectionFlow::PathNode sink
|
||||||
where DsnInjectionFlow::flowPath(source, sink)
|
where DsnInjectionFlow::flowPath(source, sink)
|
||||||
|
|
|
@ -36,7 +36,7 @@ class PassthroughTypeName extends string {
|
||||||
}
|
}
|
||||||
|
|
||||||
module UntrustedToPassthroughTypeConversionConfig implements DataFlow::ConfigSig {
|
module UntrustedToPassthroughTypeConversionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
additional predicate isSinkToPassthroughType(DataFlow::TypeCastNode sink, PassthroughTypeName name) {
|
additional predicate isSinkToPassthroughType(DataFlow::TypeCastNode sink, PassthroughTypeName name) {
|
||||||
exists(Type typ |
|
exists(Type typ |
|
||||||
|
@ -53,7 +53,7 @@ module UntrustedToPassthroughTypeConversionConfig implements DataFlow::ConfigSig
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks taint flow for reasoning about when a `ThreatModelFlowSource` is
|
* Tracks taint flow for reasoning about when a `ActiveThreatModelSource` is
|
||||||
* converted into a special "passthrough" type which will not be escaped by the
|
* converted into a special "passthrough" type which will not be escaped by the
|
||||||
* template generator; this allows the injection of arbitrary content (html,
|
* template generator; this allows the injection of arbitrary content (html,
|
||||||
* css, js) into the generated output of the templates.
|
* css, js) into the generated output of the templates.
|
||||||
|
@ -109,13 +109,13 @@ predicate isSinkToTemplateExec(DataFlow::Node sink, DataFlow::CallNode call) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module FromUntrustedToTemplateExecutionCallConfig implements DataFlow::ConfigSig {
|
module FromUntrustedToTemplateExecutionCallConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { isSinkToTemplateExec(sink, _) }
|
predicate isSink(DataFlow::Node sink) { isSinkToTemplateExec(sink, _) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks taint flow from a `ThreatModelFlowSource` into a template executor
|
* Tracks taint flow from a `ActiveThreatModelSource` into a template executor
|
||||||
* call.
|
* call.
|
||||||
*/
|
*/
|
||||||
module FromUntrustedToTemplateExecutionCallFlow =
|
module FromUntrustedToTemplateExecutionCallFlow =
|
||||||
|
|
|
@ -52,7 +52,7 @@ deprecated class Configuration extends TaintTracking::Configuration {
|
||||||
Configuration() { this = "Condtional Expression Check Bypass" }
|
Configuration() { this = "Condtional Expression Check Bypass" }
|
||||||
|
|
||||||
override predicate isSource(DataFlow::Node source) {
|
override predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource
|
source instanceof ActiveThreatModelSource
|
||||||
or
|
or
|
||||||
exists(DataFlow::FieldReadNode f |
|
exists(DataFlow::FieldReadNode f |
|
||||||
f.getField().hasQualifiedName("net/http", "Request", "Host")
|
f.getField().hasQualifiedName("net/http", "Request", "Host")
|
||||||
|
@ -71,7 +71,7 @@ deprecated class Configuration extends TaintTracking::Configuration {
|
||||||
|
|
||||||
private module Config implements DataFlow::ConfigSig {
|
private module Config implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource
|
source instanceof ActiveThreatModelSource
|
||||||
or
|
or
|
||||||
exists(DataFlow::FieldReadNode f |
|
exists(DataFlow::FieldReadNode f |
|
||||||
f.getField().hasQualifiedName("net/http", "Request", "Host")
|
f.getField().hasQualifiedName("net/http", "Request", "Host")
|
||||||
|
|
|
@ -14,7 +14,7 @@ import go
|
||||||
|
|
||||||
module Config implements DataFlow::ConfigSig {
|
module Config implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource
|
source instanceof ActiveThreatModelSource
|
||||||
or
|
or
|
||||||
source = any(Field f | f.hasQualifiedName("net/http", "Request", "Host")).getARead()
|
source = any(Field f | f.hasQualifiedName("net/http", "Request", "Host")).getARead()
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,14 +87,14 @@ module ServerSideRequestForgery {
|
||||||
abstract class SanitizerEdge extends DataFlow::Node { }
|
abstract class SanitizerEdge extends DataFlow::Node { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use `ThreatModelFlowSource` or `Source` instead.
|
* DEPRECATED: Use `ActiveThreatModelSource` or `Source` instead.
|
||||||
*/
|
*/
|
||||||
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
deprecated class UntrustedFlowAsSource = ThreatModelFlowAsSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An user controlled input, considered as a flow source for request forgery.
|
* An user controlled input, considered as a flow source for request forgery.
|
||||||
*/
|
*/
|
||||||
private class ThreatModelFlowAsSource extends Source instanceof ThreatModelFlowSource { }
|
private class ThreatModelFlowAsSource extends Source instanceof ActiveThreatModelSource { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The URL of an HTTP request, viewed as a sink for request forgery.
|
* The URL of an HTTP request, viewed as a sink for request forgery.
|
||||||
|
|
|
@ -52,7 +52,7 @@ class AllowCredentialsHeaderWrite extends Http::HeaderWrite {
|
||||||
}
|
}
|
||||||
|
|
||||||
module UntrustedToAllowOriginHeaderConfig implements DataFlow::ConfigSig {
|
module UntrustedToAllowOriginHeaderConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
additional predicate isSinkHW(DataFlow::Node sink, AllowOriginHeaderWrite hw) {
|
additional predicate isSinkHW(DataFlow::Node sink, AllowOriginHeaderWrite hw) {
|
||||||
sink = hw.getValue()
|
sink = hw.getValue()
|
||||||
|
@ -70,7 +70,7 @@ module UntrustedToAllowOriginHeaderConfig implements DataFlow::ConfigSig {
|
||||||
}
|
}
|
||||||
|
|
||||||
module UntrustedToAllowOriginConfigConfig implements DataFlow::ConfigSig {
|
module UntrustedToAllowOriginConfigConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
additional predicate isSinkWrite(DataFlow::Node sink, GinCors::AllowOriginsWrite w) { sink = w }
|
additional predicate isSinkWrite(DataFlow::Node sink, GinCors::AllowOriginsWrite w) { sink = w }
|
||||||
|
|
||||||
|
@ -78,13 +78,13 @@ module UntrustedToAllowOriginConfigConfig implements DataFlow::ConfigSig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks taint flowfor reasoning about when a `ThreatModelFlowSource` flows to
|
* Tracks taint flowfor reasoning about when a `ActiveThreatModelSource` flows to
|
||||||
* a `HeaderWrite` that writes an `Access-Control-Allow-Origin` header's value.
|
* a `HeaderWrite` that writes an `Access-Control-Allow-Origin` header's value.
|
||||||
*/
|
*/
|
||||||
module UntrustedToAllowOriginHeaderFlow = TaintTracking::Global<UntrustedToAllowOriginHeaderConfig>;
|
module UntrustedToAllowOriginHeaderFlow = TaintTracking::Global<UntrustedToAllowOriginHeaderConfig>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks taint flowfor reasoning about when a `ThreatModelFlowSource` flows to
|
* Tracks taint flowfor reasoning about when a `ActiveThreatModelSource` flows to
|
||||||
* a `AllowOriginsWrite` that writes an `Access-Control-Allow-Origin` header's value.
|
* a `AllowOriginsWrite` that writes an `Access-Control-Allow-Origin` header's value.
|
||||||
*/
|
*/
|
||||||
module UntrustedToAllowOriginConfigFlow = TaintTracking::Global<UntrustedToAllowOriginConfigConfig>;
|
module UntrustedToAllowOriginConfigFlow = TaintTracking::Global<UntrustedToAllowOriginConfigConfig>;
|
||||||
|
@ -121,7 +121,7 @@ predicate allowCredentialsIsSetToTrue(DataFlow::ExprNode allowOriginHW) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if the provided `allowOriginHW` HeaderWrite's value is set using an
|
* Holds if the provided `allowOriginHW` HeaderWrite's value is set using an
|
||||||
* ThreatModelFlowSource.
|
* ActiveThreatModelSource.
|
||||||
* The `message` parameter is populated with the warning message to be returned by the query.
|
* The `message` parameter is populated with the warning message to be returned by the query.
|
||||||
*/
|
*/
|
||||||
predicate flowsFromUntrustedToAllowOrigin(DataFlow::ExprNode allowOriginHW, string message) {
|
predicate flowsFromUntrustedToAllowOrigin(DataFlow::ExprNode allowOriginHW, string message) {
|
||||||
|
@ -169,7 +169,7 @@ class MapRead extends DataFlow::ElementReadNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
module FromUntrustedConfig implements DataFlow::ConfigSig {
|
module FromUntrustedConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { isSinkCgn(sink, _) }
|
predicate isSink(DataFlow::Node sink) { isSinkCgn(sink, _) }
|
||||||
|
|
||||||
|
@ -208,13 +208,13 @@ module FromUntrustedConfig implements DataFlow::ConfigSig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks taint flow for reasoning about when a `ThreatModelFlowSource` flows
|
* Tracks taint flow for reasoning about when a `ActiveThreatModelSource` flows
|
||||||
* somewhere.
|
* somewhere.
|
||||||
*/
|
*/
|
||||||
module FromUntrustedFlow = TaintTracking::Global<FromUntrustedConfig>;
|
module FromUntrustedFlow = TaintTracking::Global<FromUntrustedConfig>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if the provided `allowOriginHW` is also destination of a `ThreatModelFlowSource`.
|
* Holds if the provided `allowOriginHW` is also destination of a `ActiveThreatModelSource`.
|
||||||
*/
|
*/
|
||||||
predicate flowsToGuardedByCheckOnUntrusted(DataFlow::ExprNode allowOriginHW) {
|
predicate flowsToGuardedByCheckOnUntrusted(DataFlow::ExprNode allowOriginHW) {
|
||||||
exists(DataFlow::Node sink, ControlFlow::ConditionGuardNode cgn |
|
exists(DataFlow::Node sink, ControlFlow::ConditionGuardNode cgn |
|
||||||
|
|
|
@ -29,7 +29,7 @@ module DecompressionBomb {
|
||||||
class FlowState = DecompressionBombs::FlowState;
|
class FlowState = DecompressionBombs::FlowState;
|
||||||
|
|
||||||
predicate isSource(DataFlow::Node source, FlowState state) {
|
predicate isSource(DataFlow::Node source, FlowState state) {
|
||||||
source instanceof ThreatModelFlowSource and
|
source instanceof ActiveThreatModelSource and
|
||||||
state = ""
|
state = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ private import semmle.go.dataflow.ExternalFlow
|
||||||
private import semmle.go.dataflow.DataFlow
|
private import semmle.go.dataflow.DataFlow
|
||||||
|
|
||||||
private module ThreatModelConfig implements DataFlow::ConfigSig {
|
private module ThreatModelConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
sink = any(DataFlow::CallNode c | c.getTarget().getName() = "sink").getAnArgument()
|
sink = any(DataFlow::CallNode c | c.getTarget().getName() = "sink").getAnArgument()
|
||||||
|
|
|
@ -6,7 +6,7 @@ module SourceTest implements TestSig {
|
||||||
string getARelevantTag() { result = "source" }
|
string getARelevantTag() { result = "source" }
|
||||||
|
|
||||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||||
exists(ThreatModelFlowSource s |
|
exists(ActiveThreatModelSource s |
|
||||||
s.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
s.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||||
element = s.toString() and
|
element = s.toString() and
|
||||||
|
|
|
@ -6,7 +6,7 @@ module SourceTest implements TestSig {
|
||||||
string getARelevantTag() { result = "source" }
|
string getARelevantTag() { result = "source" }
|
||||||
|
|
||||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||||
exists(ThreatModelFlowSource s |
|
exists(ActiveThreatModelSource s |
|
||||||
s.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
s.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||||
element = s.toString() and
|
element = s.toString() and
|
||||||
|
|
|
@ -202,7 +202,7 @@ abstract class LocalUserInput extends UserInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use the threat models feature.
|
* DEPRECATED: Use the threat models feature.
|
||||||
* That is, use `ThreatModelFlowSource` as the class of nodes for sources
|
* That is, use `ActiveThreatModelSource` as the class of nodes for sources
|
||||||
* and set up the threat model configuration to filter source nodes.
|
* and set up the threat model configuration to filter source nodes.
|
||||||
* Alternatively, use `getThreatModel` to filter nodes to create the
|
* Alternatively, use `getThreatModel` to filter nodes to create the
|
||||||
* class of nodes you need.
|
* class of nodes you need.
|
||||||
|
@ -273,7 +273,7 @@ private class FileInput extends LocalUserInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEPRECATED: Use the threat models feature.
|
* DEPRECATED: Use the threat models feature.
|
||||||
* That is, use `ThreatModelFlowSource` as the class of nodes for sources
|
* That is, use `ActiveThreatModelSource` as the class of nodes for sources
|
||||||
* and set up the threat model configuration to filter source nodes.
|
* and set up the threat model configuration to filter source nodes.
|
||||||
* Alternatively, use `getThreatModel` to filter nodes to create the
|
* Alternatively, use `getThreatModel` to filter nodes to create the
|
||||||
* class of nodes you need.
|
* class of nodes you need.
|
||||||
|
|
|
@ -640,7 +640,7 @@ private MethodCall callReturningSameType(Expr ref) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private SrcRefType entrypointType() {
|
private SrcRefType entrypointType() {
|
||||||
exists(ThreatModelFlowSource s, RefType t |
|
exists(ActiveThreatModelSource s, RefType t |
|
||||||
s instanceof DataFlow::ExplicitParameterNode and
|
s instanceof DataFlow::ExplicitParameterNode and
|
||||||
t = pragma[only_bind_out](s).getType() and
|
t = pragma[only_bind_out](s).getType() and
|
||||||
not t instanceof TypeObject and
|
not t instanceof TypeObject and
|
||||||
|
|
|
@ -9,7 +9,7 @@ import semmle.code.java.security.AndroidIntentRedirection
|
||||||
|
|
||||||
/** A taint tracking configuration for tainted Intents being used to start Android components. */
|
/** A taint tracking configuration for tainted Intents being used to start Android components. */
|
||||||
module IntentRedirectionConfig implements DataFlow::ConfigSig {
|
module IntentRedirectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof IntentRedirectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof IntentRedirectionSink }
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ private class OriginalIntentSanitizer extends IntentRedirectionSanitizer {
|
||||||
* flowing directly to sinks that start Android components.
|
* flowing directly to sinks that start Android components.
|
||||||
*/
|
*/
|
||||||
private module SameIntentBeingRelaunchedConfig implements DataFlow::ConfigSig {
|
private module SameIntentBeingRelaunchedConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof IntentRedirectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof IntentRedirectionSink }
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ private class IntentWithTaintedComponent extends DataFlow::Node {
|
||||||
* A taint tracking configuration for tainted data flowing to an `Intent`'s component.
|
* A taint tracking configuration for tainted data flowing to an `Intent`'s component.
|
||||||
*/
|
*/
|
||||||
private module TaintedIntentComponentConfig implements DataFlow::ConfigSig {
|
private module TaintedIntentComponentConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
any(IntentSetComponent setComponent).getSink() = sink.asExpr()
|
any(IntentSetComponent setComponent).getSink() = sink.asExpr()
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ExternalApkSource extends ApiSourceNode {
|
||||||
sourceNode(this, "android-external-storage-dir") or
|
sourceNode(this, "android-external-storage-dir") or
|
||||||
this.asExpr().(MethodCall).getMethod() instanceof UriConstructorMethod or
|
this.asExpr().(MethodCall).getMethod() instanceof UriConstructorMethod or
|
||||||
this.asExpr().(StringLiteral).getValue().matches("file://%") or
|
this.asExpr().(StringLiteral).getValue().matches("file://%") or
|
||||||
this instanceof ThreatModelFlowSource
|
this instanceof ActiveThreatModelSource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ private import semmle.code.java.security.ArithmeticCommon
|
||||||
|
|
||||||
/** A taint-tracking configuration to reason about overflow from unvalidated input. */
|
/** A taint-tracking configuration to reason about overflow from unvalidated input. */
|
||||||
module ArithmeticOverflowConfig implements DataFlow::ConfigSig {
|
module ArithmeticOverflowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { overflowSink(_, sink.asExpr()) }
|
predicate isSink(DataFlow::Node sink) { overflowSink(_, sink.asExpr()) }
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ deprecated module RemoteUserInputOverflowConfig = ArithmeticOverflowConfig;
|
||||||
|
|
||||||
/** A taint-tracking configuration to reason about underflow from unvalidated input. */
|
/** A taint-tracking configuration to reason about underflow from unvalidated input. */
|
||||||
module ArithmeticUnderflowConfig implements DataFlow::ConfigSig {
|
module ArithmeticUnderflowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { underflowSink(_, sink.asExpr()) }
|
predicate isSink(DataFlow::Node sink) { underflowSink(_, sink.asExpr()) }
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ private class DefaultCommandInjectionSanitizer extends CommandInjectionSanitizer
|
||||||
* A taint-tracking configuration for unvalidated user input that is used to run an external process.
|
* A taint-tracking configuration for unvalidated user input that is used to run an external process.
|
||||||
*/
|
*/
|
||||||
module InputToArgumentToExecFlowConfig implements DataFlow::ConfigSig {
|
module InputToArgumentToExecFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof CommandInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof CommandInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ private predicate endsWithStep(DataFlow::Node node1, DataFlow::Node node2) {
|
||||||
* A taint tracking configuration for untrusted data flowing to sensitive conditions.
|
* A taint tracking configuration for untrusted data flowing to sensitive conditions.
|
||||||
*/
|
*/
|
||||||
module ConditionalBypassFlowConfig implements DataFlow::ConfigSig {
|
module ConditionalBypassFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { conditionControlsMethod(_, sink.asExpr()) }
|
predicate isSink(DataFlow::Node sink) { conditionControlsMethod(_, sink.asExpr()) }
|
||||||
|
|
||||||
|
|
|
@ -93,10 +93,10 @@ class ExternalApiDataNode extends DataFlow::Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Taint tracking configuration for flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s.
|
* Taint tracking configuration for flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s.
|
||||||
*/
|
*/
|
||||||
module UntrustedDataToExternalApiConfig implements DataFlow::ConfigSig {
|
module UntrustedDataToExternalApiConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
|
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ private class StringFormatSink extends ApiSinkNode {
|
||||||
* A taint-tracking configuration for externally controlled format string vulnerabilities.
|
* A taint-tracking configuration for externally controlled format string vulnerabilities.
|
||||||
*/
|
*/
|
||||||
module ExternallyControlledFormatStringConfig implements DataFlow::ConfigSig {
|
module ExternallyControlledFormatStringConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof StringFormatSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof StringFormatSink }
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import semmle.code.java.security.FragmentInjection
|
||||||
* that is used to create Android fragments dynamically.
|
* that is used to create Android fragments dynamically.
|
||||||
*/
|
*/
|
||||||
module FragmentInjectionTaintConfig implements DataFlow::ConfigSig {
|
module FragmentInjectionTaintConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof FragmentInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof FragmentInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import semmle.code.java.security.GroovyInjection
|
||||||
* that is used to evaluate a Groovy expression.
|
* that is used to evaluate a Groovy expression.
|
||||||
*/
|
*/
|
||||||
module GroovyInjectionConfig implements DataFlow::ConfigSig {
|
module GroovyInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof GroovyInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof GroovyInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ private import semmle.code.java.dataflow.FlowSources
|
||||||
* user-provided size used for array construction.
|
* user-provided size used for array construction.
|
||||||
*/
|
*/
|
||||||
module ImproperValidationOfArrayConstructionConfig implements DataFlow::ConfigSig {
|
module ImproperValidationOfArrayConstructionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
any(CheckableArrayAccess caa).canThrowOutOfBoundsDueToEmptyArray(sink.asExpr(), _)
|
any(CheckableArrayAccess caa).canThrowOutOfBoundsDueToEmptyArray(sink.asExpr(), _)
|
||||||
|
|
|
@ -9,7 +9,7 @@ private import semmle.code.java.dataflow.FlowSources
|
||||||
* of user-provided array index.
|
* of user-provided array index.
|
||||||
*/
|
*/
|
||||||
module ImproperValidationOfArrayIndexConfig implements DataFlow::ConfigSig {
|
module ImproperValidationOfArrayIndexConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
any(CheckableArrayAccess caa).canThrowOutOfBounds(sink.asExpr())
|
any(CheckableArrayAccess caa).canThrowOutOfBounds(sink.asExpr())
|
||||||
|
|
|
@ -46,7 +46,7 @@ class SetMessageInterpolatorCall extends MethodCall {
|
||||||
* to the argument of a method that builds constraint error messages.
|
* to the argument of a method that builds constraint error messages.
|
||||||
*/
|
*/
|
||||||
module BeanValidationConfig implements DataFlow::ConfigSig {
|
module BeanValidationConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof BeanValidationSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof BeanValidationSink }
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ private import IntentUriPermissionManipulation
|
||||||
* A taint tracking configuration for user-provided Intents being returned to third party apps.
|
* A taint tracking configuration for user-provided Intents being returned to third party apps.
|
||||||
*/
|
*/
|
||||||
module IntentUriPermissionManipulationConfig implements DataFlow::ConfigSig {
|
module IntentUriPermissionManipulationConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof IntentUriPermissionManipulationSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof IntentUriPermissionManipulationSink }
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ private class DefaultJexlInjectionAdditionalTaintStep extends JexlInjectionAddit
|
||||||
* It supports both JEXL 2 and 3.
|
* It supports both JEXL 2 and 3.
|
||||||
*/
|
*/
|
||||||
module JexlInjectionConfig implements DataFlow::ConfigSig {
|
module JexlInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof JexlEvaluationSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof JexlEvaluationSink }
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ private import semmle.code.java.security.Sanitizers
|
||||||
* A taint-tracking configuration for unvalidated user input that is used in JNDI lookup.
|
* A taint-tracking configuration for unvalidated user input that is used in JNDI lookup.
|
||||||
*/
|
*/
|
||||||
module JndiInjectionFlowConfig implements DataFlow::ConfigSig {
|
module JndiInjectionFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof JndiInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof JndiInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import semmle.code.java.security.LdapInjection
|
||||||
* A taint-tracking configuration for unvalidated user input that is used to construct LDAP queries.
|
* A taint-tracking configuration for unvalidated user input that is used to construct LDAP queries.
|
||||||
*/
|
*/
|
||||||
module LdapInjectionFlowConfig implements DataFlow::ConfigSig {
|
module LdapInjectionFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof LdapInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof LdapInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import semmle.code.java.security.LogInjection
|
||||||
* A taint-tracking configuration for tracking untrusted user input used in log entries.
|
* A taint-tracking configuration for tracking untrusted user input used in log entries.
|
||||||
*/
|
*/
|
||||||
module LogInjectionConfig implements DataFlow::ConfigSig {
|
module LogInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof LogInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof LogInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import semmle.code.java.security.MvelInjection
|
||||||
* that is used to construct and evaluate a MVEL expression.
|
* that is used to construct and evaluate a MVEL expression.
|
||||||
*/
|
*/
|
||||||
module MvelInjectionFlowConfig implements DataFlow::ConfigSig {
|
module MvelInjectionFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof MvelEvaluationSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof MvelEvaluationSink }
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ private predicate smallExpr(Expr e) {
|
||||||
* numeric cast.
|
* numeric cast.
|
||||||
*/
|
*/
|
||||||
module NumericCastFlowConfig implements DataFlow::ConfigSig {
|
module NumericCastFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
sink.asExpr() = any(NumericNarrowingCastExpr cast).getExpr() and
|
sink.asExpr() = any(NumericNarrowingCastExpr cast).getExpr() and
|
||||||
|
|
|
@ -9,7 +9,7 @@ private import semmle.code.java.security.Sanitizers
|
||||||
* A taint-tracking configuration for unvalidated user input that is used in OGNL EL evaluation.
|
* A taint-tracking configuration for unvalidated user input that is used in OGNL EL evaluation.
|
||||||
*/
|
*/
|
||||||
module OgnlInjectionFlowConfig implements DataFlow::ConfigSig {
|
module OgnlInjectionFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof OgnlInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof OgnlInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import semmle.code.java.dataflow.FlowSources
|
||||||
* and remains vulnerable to Partial Path Traversal.
|
* and remains vulnerable to Partial Path Traversal.
|
||||||
*/
|
*/
|
||||||
module PartialPathTraversalFromRemoteConfig implements DataFlow::ConfigSig {
|
module PartialPathTraversalFromRemoteConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node node) { node instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node node) { node instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node node) {
|
predicate isSink(DataFlow::Node node) {
|
||||||
any(PartialPathTraversalMethodCall ma).getQualifier() = node.asExpr()
|
any(PartialPathTraversalMethodCall ma).getQualifier() = node.asExpr()
|
||||||
|
|
|
@ -12,7 +12,7 @@ import semmle.code.java.security.RequestForgery
|
||||||
*/
|
*/
|
||||||
module RequestForgeryConfig implements DataFlow::ConfigSig {
|
module RequestForgeryConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource and
|
source instanceof ActiveThreatModelSource and
|
||||||
// Exclude results of remote HTTP requests: fetching something else based on that result
|
// Exclude results of remote HTTP requests: fetching something else based on that result
|
||||||
// is no worse than following a redirect returned by the remote server, and typically
|
// is no worse than following a redirect returned by the remote server, and typically
|
||||||
// we're requesting a resource via https which we trust to only send us to safe URLs.
|
// we're requesting a resource via https which we trust to only send us to safe URLs.
|
||||||
|
|
|
@ -10,7 +10,7 @@ import semmle.code.java.security.ResponseSplitting
|
||||||
*/
|
*/
|
||||||
module ResponseSplittingConfig implements DataFlow::ConfigSig {
|
module ResponseSplittingConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource and
|
source instanceof ActiveThreatModelSource and
|
||||||
not source instanceof SafeHeaderSplittingSource
|
not source instanceof SafeHeaderSplittingSource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ private class ResultReceiverSendCall extends MethodCall {
|
||||||
}
|
}
|
||||||
|
|
||||||
private module UntrustedResultReceiverConfig implements DataFlow::ConfigSig {
|
private module UntrustedResultReceiverConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node node) { node instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node node) { node instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node node) {
|
predicate isSink(DataFlow::Node node) {
|
||||||
node.asExpr() = any(ResultReceiverSendCall c).getReceiver()
|
node.asExpr() = any(ResultReceiverSendCall c).getReceiver()
|
||||||
|
|
|
@ -11,7 +11,7 @@ private import semmle.code.java.security.SpelInjection
|
||||||
* that is used to construct and evaluate a SpEL expression.
|
* that is used to construct and evaluate a SpEL expression.
|
||||||
*/
|
*/
|
||||||
module SpelInjectionConfig implements DataFlow::ConfigSig {
|
module SpelInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof SpelExpressionEvaluationSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof SpelExpressionEvaluationSink }
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import semmle.code.java.security.QueryInjection
|
||||||
* A taint-tracking configuration for unvalidated user input that is used in SQL queries.
|
* A taint-tracking configuration for unvalidated user input that is used in SQL queries.
|
||||||
*/
|
*/
|
||||||
module QueryInjectionFlowConfig implements DataFlow::ConfigSig {
|
module QueryInjectionFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof QueryInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof QueryInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ abstract class ExecTaintedEnvironmentSanitizer extends DataFlow::Node { }
|
||||||
* A taint-tracking configuration that tracks flow from unvalidated data to an environment variable for a subprocess.
|
* A taint-tracking configuration that tracks flow from unvalidated data to an environment variable for a subprocess.
|
||||||
*/
|
*/
|
||||||
module ExecTaintedEnvironmentConfig implements DataFlow::ConfigSig {
|
module ExecTaintedEnvironmentConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof ExecTaintedEnvironmentSanitizer }
|
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof ExecTaintedEnvironmentSanitizer }
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ private class TaintPreservingUriCtorParam extends Parameter {
|
||||||
* A taint-tracking configuration for tracking flow from remote sources to the creation of a path.
|
* A taint-tracking configuration for tracking flow from remote sources to the creation of a path.
|
||||||
*/
|
*/
|
||||||
module TaintedPathConfig implements DataFlow::ConfigSig {
|
module TaintedPathConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof TaintedPathSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof TaintedPathSink }
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ private class WildCardPermissionConstruction extends ClassInstanceExpr, Permissi
|
||||||
* A configuration for tracking flow from user input to a permissions check.
|
* A configuration for tracking flow from user input to a permissions check.
|
||||||
*/
|
*/
|
||||||
module TaintedPermissionsCheckFlowConfig implements DataFlow::ConfigSig {
|
module TaintedPermissionsCheckFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
sink.asExpr() = any(PermissionsConstruction p).getInput()
|
sink.asExpr() = any(PermissionsConstruction p).getInput()
|
||||||
|
|
|
@ -83,7 +83,7 @@ abstract deprecated class TemplateInjectionSanitizerWithState extends DataFlow::
|
||||||
abstract deprecated predicate hasState(DataFlow::FlowState state);
|
abstract deprecated predicate hasState(DataFlow::FlowState state);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DefaultTemplateInjectionSource extends TemplateInjectionSource instanceof ThreatModelFlowSource
|
private class DefaultTemplateInjectionSource extends TemplateInjectionSource instanceof ActiveThreatModelSource
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
private class DefaultTemplateInjectionSink extends TemplateInjectionSink {
|
private class DefaultTemplateInjectionSink extends TemplateInjectionSink {
|
||||||
|
|
|
@ -13,7 +13,7 @@ private import semmle.code.java.security.Sanitizers
|
||||||
*/
|
*/
|
||||||
abstract class TrustBoundaryViolationSource extends DataFlow::Node { }
|
abstract class TrustBoundaryViolationSource extends DataFlow::Node { }
|
||||||
|
|
||||||
private class ThreatModelSource extends TrustBoundaryViolationSource instanceof ThreatModelFlowSource
|
private class ThreatModelSource extends TrustBoundaryViolationSource instanceof ActiveThreatModelSource
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@ import semmle.code.java.security.UnsafeAndroidAccess
|
||||||
* A taint configuration tracking flow from untrusted inputs to a resource fetching call.
|
* A taint configuration tracking flow from untrusted inputs to a resource fetching call.
|
||||||
*/
|
*/
|
||||||
module FetchUntrustedResourceConfig implements DataFlow::ConfigSig {
|
module FetchUntrustedResourceConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof UrlResourceSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof UrlResourceSink }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import semmle.code.java.security.UnsafeContentUriResolution
|
||||||
* A taint-tracking configuration to find paths from remote sources to content URI resolutions.
|
* A taint-tracking configuration to find paths from remote sources to content URI resolutions.
|
||||||
*/
|
*/
|
||||||
module UnsafeContentResolutionConfig implements DataFlow::ConfigSig {
|
module UnsafeContentResolutionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof ContentUriResolutionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof ContentUriResolutionSink }
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ private predicate isUnsafeDeserializationTaintStep(DataFlow::Node pred, DataFlow
|
||||||
|
|
||||||
/** Tracks flows from remote user input to a deserialization sink. */
|
/** Tracks flows from remote user input to a deserialization sink. */
|
||||||
private module UnsafeDeserializationConfig implements DataFlow::ConfigSig {
|
private module UnsafeDeserializationConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeDeserializationSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeDeserializationSink }
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ private predicate isUnsafeTypeAdditionalTaintStep(DataFlow::Node fromNode, DataF
|
||||||
* If this is user-controlled, arbitrary code could be executed while instantiating the user-specified type.
|
* If this is user-controlled, arbitrary code could be executed while instantiating the user-specified type.
|
||||||
*/
|
*/
|
||||||
module UnsafeTypeConfig implements DataFlow::ConfigSig {
|
module UnsafeTypeConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeTypeSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeTypeSink }
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ private class FullyDecodesUrlBarrier extends DataFlow::Node {
|
||||||
*/
|
*/
|
||||||
module UrlForwardFlowConfig implements DataFlow::ConfigSig {
|
module UrlForwardFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) {
|
predicate isSource(DataFlow::Node source) {
|
||||||
source instanceof ThreatModelFlowSource and
|
source instanceof ActiveThreatModelSource and
|
||||||
// excluded due to FPs
|
// excluded due to FPs
|
||||||
not exists(MethodCall mc, Method m |
|
not exists(MethodCall mc, Method m |
|
||||||
m instanceof HttpServletRequestGetRequestUriMethod or
|
m instanceof HttpServletRequestGetRequestUriMethod or
|
||||||
|
|
|
@ -8,7 +8,7 @@ private import semmle.code.java.security.UrlRedirect
|
||||||
* A taint-tracking configuration for reasoning about URL redirections.
|
* A taint-tracking configuration for reasoning about URL redirections.
|
||||||
*/
|
*/
|
||||||
module UrlRedirectConfig implements DataFlow::ConfigSig {
|
module UrlRedirectConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ private import semmle.code.java.security.XPath
|
||||||
* A taint-tracking configuration for reasoning about XPath injection vulnerabilities.
|
* A taint-tracking configuration for reasoning about XPath injection vulnerabilities.
|
||||||
*/
|
*/
|
||||||
module XPathInjectionConfig implements DataFlow::ConfigSig {
|
module XPathInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof XPathInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof XPathInjectionSink }
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ private import semmle.code.java.security.Sanitizers
|
||||||
* A taint-tracking configuration for unvalidated user input that is used in XSLT transformation.
|
* A taint-tracking configuration for unvalidated user input that is used in XSLT transformation.
|
||||||
*/
|
*/
|
||||||
module XsltInjectionFlowConfig implements DataFlow::ConfigSig {
|
module XsltInjectionFlowConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof XsltInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof XsltInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import semmle.code.java.security.XSS
|
||||||
* A taint-tracking configuration for cross site scripting vulnerabilities.
|
* A taint-tracking configuration for cross site scripting vulnerabilities.
|
||||||
*/
|
*/
|
||||||
module XssConfig implements DataFlow::ConfigSig {
|
module XssConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof XssSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof XssSink }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ private import semmle.code.java.security.XxeQuery
|
||||||
* A taint-tracking configuration for unvalidated remote user input that is used in XML external entity expansion.
|
* A taint-tracking configuration for unvalidated remote user input that is used in XML external entity expansion.
|
||||||
*/
|
*/
|
||||||
module XxeConfig implements DataFlow::ConfigSig {
|
module XxeConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof XxeSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof XxeSink }
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ private class LengthRestrictedMethod extends Method {
|
||||||
|
|
||||||
/** A configuration for Polynomial ReDoS queries. */
|
/** A configuration for Polynomial ReDoS queries. */
|
||||||
module PolynomialRedosConfig implements DataFlow::ConfigSig {
|
module PolynomialRedosConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node src) { src instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node src) { src instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(SuperlinearBackTracking::PolynomialBackTrackingTerm regexp |
|
exists(SuperlinearBackTracking::PolynomialBackTrackingTerm regexp |
|
||||||
|
|
|
@ -9,7 +9,7 @@ import semmle.code.java.security.regexp.RegexInjection
|
||||||
* A taint-tracking configuration for untrusted user input used to construct regular expressions.
|
* A taint-tracking configuration for untrusted user input used to construct regular expressions.
|
||||||
*/
|
*/
|
||||||
module RegexInjectionConfig implements DataFlow::ConfigSig {
|
module RegexInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof RegexInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof RegexInjectionSink }
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class Log4jInjectionSanitizer extends DataFlow::Node instanceof SimpleTypeSaniti
|
||||||
* A taint-tracking configuration for tracking untrusted user input used in log entries.
|
* A taint-tracking configuration for tracking untrusted user input used in log entries.
|
||||||
*/
|
*/
|
||||||
module Log4jInjectionConfig implements DataFlow::ConfigSig {
|
module Log4jInjectionConfig implements DataFlow::ConfigSig {
|
||||||
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof Log4jInjectionSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof Log4jInjectionSink }
|
||||||
|
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче