diff --git a/python/ql/lib/semmle/python/security/dataflow/CleartextLoggingQuery.qll b/python/ql/lib/semmle/python/security/dataflow/CleartextLoggingQuery.qll index 03b1db49d170..def13197d4aa 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CleartextLoggingQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CleartextLoggingQuery.qll @@ -21,6 +21,8 @@ private module CleartextLoggingConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "Clear-text logging of sensitive information" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/CleartextStorageQuery.qll b/python/ql/lib/semmle/python/security/dataflow/CleartextStorageQuery.qll index 7ee85230c84f..190a8536887d 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CleartextStorageQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CleartextStorageQuery.qll @@ -21,6 +21,8 @@ private module CleartextStorageConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "Clear-text storage of sensitive information" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/CodeInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/CodeInjectionQuery.qll index 486d06a6b21b..188bf56f30a2 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CodeInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CodeInjectionQuery.qll @@ -17,6 +17,8 @@ private module CodeInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "code injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/CommandInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/CommandInjectionQuery.qll index 18bcbe8cdd5e..cc2358c9a697 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CommandInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CommandInjectionQuery.qll @@ -20,6 +20,8 @@ module CommandInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "command injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/CookieInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/CookieInjectionQuery.qll index 2b089fb27793..e017ec959f41 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CookieInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CookieInjectionQuery.qll @@ -20,6 +20,8 @@ module CookieInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "cookie injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionQuery.qll index 1583ee704918..82266f531622 100644 --- a/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionQuery.qll @@ -16,6 +16,8 @@ private module HeaderInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node node) { node instanceof HttpHeaderInjection::Sink } predicate isBarrier(DataFlow::Node node) { node instanceof HttpHeaderInjection::Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "HTTP Header injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/LdapInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/LdapInjectionQuery.qll index 527c1cbfe432..7d0f5da6a5a5 100644 --- a/python/ql/lib/semmle/python/security/dataflow/LdapInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/LdapInjectionQuery.qll @@ -19,6 +19,8 @@ private module LdapInjectionDnConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof DnSink } predicate isBarrier(DataFlow::Node node) { node instanceof DnSanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "LDAP injection via the distinguished name (DN) parameter" vulnerabilities. */ @@ -30,6 +32,8 @@ private module LdapInjectionFilterConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof FilterSink } predicate isBarrier(DataFlow::Node node) { node instanceof FilterSanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "LDAP injection via the filter parameter" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/LogInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/LogInjectionQuery.qll index 7204accbdcf2..fa392cd2d58b 100644 --- a/python/ql/lib/semmle/python/security/dataflow/LogInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/LogInjectionQuery.qll @@ -17,6 +17,8 @@ private module LogInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "log injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/NoSqlInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/NoSqlInjectionQuery.qll index 5b0daacb737b..a1b5eeb6a93a 100644 --- a/python/ql/lib/semmle/python/security/dataflow/NoSqlInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/NoSqlInjectionQuery.qll @@ -56,6 +56,8 @@ module NoSqlInjectionConfig implements DataFlow::StateConfigSig { predicate isBarrier(DataFlow::Node node) { node = any(NoSqlSanitizer noSqlSanitizer).getAnInput() } + + predicate observeDiffInformedIncrementalMode() { any() } } module NoSqlInjectionFlow = TaintTracking::GlobalWithState; diff --git a/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationQuery.qll b/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationQuery.qll index eb83d0bf84f0..8221083b1843 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationQuery.qll @@ -31,6 +31,8 @@ private module PamAuthorizationConfig implements DataFlow::ConfigSig { // Flow from handle to the authenticate call in the final step exists(VulnPamAuthCall c | c.getArg(0) = node1 | node2 = c) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "PAM Authorization" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/PathInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/PathInjectionQuery.qll index b3081fd9996a..f8bca406ece5 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PathInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PathInjectionQuery.qll @@ -71,6 +71,8 @@ module PathInjectionConfig implements DataFlow::StateConfigSig { stateFrom instanceof NotNormalized and stateTo instanceof NormalizedUnchecked } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "path injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll index 4e082aac26e4..af08ca514382 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll @@ -17,6 +17,8 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "polynomial regular expression denial of service (ReDoS)" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/ReflectedXssQuery.qll b/python/ql/lib/semmle/python/security/dataflow/ReflectedXssQuery.qll index 5f5b2dd58df5..223f0643183b 100644 --- a/python/ql/lib/semmle/python/security/dataflow/ReflectedXssQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/ReflectedXssQuery.qll @@ -17,6 +17,8 @@ private module ReflectedXssConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "reflected server-side cross-site scripting" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/RegexInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/RegexInjectionQuery.qll index ae21270a63ea..4b1d59112036 100644 --- a/python/ql/lib/semmle/python/security/dataflow/RegexInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/RegexInjectionQuery.qll @@ -18,6 +18,8 @@ private module RegexInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "regular expression injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryQuery.qll b/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryQuery.qll index 4cae5a301b1f..f11cf7c590d2 100644 --- a/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryQuery.qll @@ -29,6 +29,10 @@ private module FullServerSideRequestForgeryConfig implements DataFlow::ConfigSig or node instanceof FullUrlControlSanitizer } + + predicate observeDiffInformedIncrementalMode() { + none() // Disabled since the alert selects the associated request object + } } /** @@ -58,6 +62,8 @@ private module PartialServerSideRequestForgeryConfig implements DataFlow::Config predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** diff --git a/python/ql/lib/semmle/python/security/dataflow/SqlInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/SqlInjectionQuery.qll index a63590643f3a..cc33baf2dd94 100644 --- a/python/ql/lib/semmle/python/security/dataflow/SqlInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/SqlInjectionQuery.qll @@ -17,6 +17,8 @@ private module SqlInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "SQL injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/StackTraceExposureQuery.qll b/python/ql/lib/semmle/python/security/dataflow/StackTraceExposureQuery.qll index 57ef6d7ebb2a..8249c68a8075 100644 --- a/python/ql/lib/semmle/python/security/dataflow/StackTraceExposureQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/StackTraceExposureQuery.qll @@ -26,6 +26,8 @@ private module StackTraceExposureConfig implements DataFlow::ConfigSig { nodeTo = attr ) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "stack trace exposure" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/TarSlipQuery.qll b/python/ql/lib/semmle/python/security/dataflow/TarSlipQuery.qll index 162bfcd74ccb..c00c60177752 100644 --- a/python/ql/lib/semmle/python/security/dataflow/TarSlipQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/TarSlipQuery.qll @@ -17,6 +17,8 @@ private module TarSlipConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "tar slip" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/TemplateInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/TemplateInjectionQuery.qll index 22c228f48d59..8764a3203a69 100644 --- a/python/ql/lib/semmle/python/security/dataflow/TemplateInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/TemplateInjectionQuery.qll @@ -17,6 +17,8 @@ private module TemplateInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node node) { node instanceof Sink } predicate isBarrierIn(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "template injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationQuery.qll b/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationQuery.qll index dd6925b79983..6edf60dcd36d 100644 --- a/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationQuery.qll @@ -17,6 +17,8 @@ private module UnsafeDeserializationConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "code execution from deserialization" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/UnsafeShellCommandConstructionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/UnsafeShellCommandConstructionQuery.qll index 51341cfe6cdc..07a4657bce8c 100644 --- a/python/ql/lib/semmle/python/security/dataflow/UnsafeShellCommandConstructionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/UnsafeShellCommandConstructionQuery.qll @@ -28,6 +28,8 @@ module UnsafeShellCommandConstructionConfig implements DataFlow::ConfigSig { // override to require the path doesn't have unmatched return steps DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSourceCallContext } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "shell command constructed from library input" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/UrlRedirectQuery.qll b/python/ql/lib/semmle/python/security/dataflow/UrlRedirectQuery.qll index a9526f33ad34..36167cfc1034 100644 --- a/python/ql/lib/semmle/python/security/dataflow/UrlRedirectQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/UrlRedirectQuery.qll @@ -32,6 +32,8 @@ private module UrlRedirectConfig implements DataFlow::StateConfigSig { ) { any(UrlRedirect::AdditionalFlowStep a).step(nodeFrom, stateFrom, nodeTo, stateTo) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "URL redirection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/WeakSensitiveDataHashingQuery.qll b/python/ql/lib/semmle/python/security/dataflow/WeakSensitiveDataHashingQuery.qll index 04d8846d7d01..a219eac00b20 100644 --- a/python/ql/lib/semmle/python/security/dataflow/WeakSensitiveDataHashingQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/WeakSensitiveDataHashingQuery.qll @@ -33,6 +33,8 @@ module NormalHashFunction { predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { sensitiveDataExtraStepForCalls(node1, node2) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "use of a broken or weak cryptographic hashing algorithm on sensitive data" vulnerabilities. */ @@ -63,6 +65,8 @@ module ComputationallyExpensiveHashFunction { predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { sensitiveDataExtraStepForCalls(node1, node2) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "use of a broken or weak cryptographic hashing algorithm on passwords" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/XmlBombQuery.qll b/python/ql/lib/semmle/python/security/dataflow/XmlBombQuery.qll index e69e8ad63c68..2c445e0aeed6 100644 --- a/python/ql/lib/semmle/python/security/dataflow/XmlBombQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/XmlBombQuery.qll @@ -17,6 +17,8 @@ private module XmlBombConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "XML bomb" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/XpathInjectionQuery.qll b/python/ql/lib/semmle/python/security/dataflow/XpathInjectionQuery.qll index 2a15669f6ff0..3a1f35f33679 100644 --- a/python/ql/lib/semmle/python/security/dataflow/XpathInjectionQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/XpathInjectionQuery.qll @@ -17,6 +17,8 @@ private module XpathInjectionConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "Xpath Injection" vulnerabilities. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/XxeQuery.qll b/python/ql/lib/semmle/python/security/dataflow/XxeQuery.qll index da7c34a5bac3..0347d159b6ec 100644 --- a/python/ql/lib/semmle/python/security/dataflow/XxeQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/XxeQuery.qll @@ -17,6 +17,8 @@ private module XxeConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "XML External Entity (XXE)" vulnerabilities. */ diff --git a/python/ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll b/python/ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll index d2b47c9a6a76..03f84b7903da 100644 --- a/python/ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll +++ b/python/ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll @@ -171,6 +171,13 @@ private module UntrustedDataToExternalApiConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource } predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode } + + predicate observeDiffInformedIncrementalMode() { + // TODO(diff-informed): Manually verify if config can be diff-informed. + // ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll:181: Flow call outside 'select' clause + // ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll:184: Flow call outside 'select' clause + none() + } } /** Global taint-tracking from `RemoteFlowSource`s to `ExternalApiDataNode`s. */ diff --git a/python/ql/src/Security/CWE-327/FluentApiModel.qll b/python/ql/src/Security/CWE-327/FluentApiModel.qll index ce62a1a590cf..d2118493e0fe 100644 --- a/python/ql/src/Security/CWE-327/FluentApiModel.qll +++ b/python/ql/src/Security/CWE-327/FluentApiModel.qll @@ -110,6 +110,12 @@ module InsecureContextConfiguration implements DataFlow::StateConfigSig { ) ) } + + predicate observeDiffInformedIncrementalMode() { + // TODO(diff-informed): Manually verify if config can be diff-informed. + // ql/src/Security/CWE-327/FluentApiModel.qll:130: Flow call outside 'select' clause + none() + } } private module InsecureContextFlow = DataFlow::GlobalWithState; diff --git a/python/ql/src/Security/CWE-798/HardcodedCredentials.ql b/python/ql/src/Security/CWE-798/HardcodedCredentials.ql index 6e48ada26a42..c8aecd7204ba 100644 --- a/python/ql/src/Security/CWE-798/HardcodedCredentials.ql +++ b/python/ql/src/Security/CWE-798/HardcodedCredentials.ql @@ -119,6 +119,8 @@ private module HardcodedCredentialsConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof HardcodedValueSource } predicate isSink(DataFlow::Node sink) { sink instanceof CredentialSink } + + predicate observeDiffInformedIncrementalMode() { any() } } module HardcodedCredentialsFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/Security/CWE-022bis/TarSlipImprov.ql b/python/ql/src/experimental/Security/CWE-022bis/TarSlipImprov.ql index 431fe293cecd..1727da1bcf55 100755 --- a/python/ql/src/experimental/Security/CWE-022bis/TarSlipImprov.ql +++ b/python/ql/src/experimental/Security/CWE-022bis/TarSlipImprov.ql @@ -109,6 +109,8 @@ private module TarSlipImprovConfig implements DataFlow::ConfigSig { nodeFrom = nodeTo.(API::CallNode).getArg(0) and nodeFrom = tarfileOpen().getReturn().getAValueReachableFromSource() } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting more "TarSlip" vulnerabilities. */ diff --git a/python/ql/src/experimental/Security/CWE-091/XsltInjectionQuery.qll b/python/ql/src/experimental/Security/CWE-091/XsltInjectionQuery.qll index 4ecae424ed1c..1430691bff8d 100644 --- a/python/ql/src/experimental/Security/CWE-091/XsltInjectionQuery.qll +++ b/python/ql/src/experimental/Security/CWE-091/XsltInjectionQuery.qll @@ -19,6 +19,8 @@ module XsltInjectionConfig implements DataFlow::ConfigSig { // opted for the more simple approach. nodeTo = elementTreeConstruction(nodeFrom) } + + predicate observeDiffInformedIncrementalMode() { any() } } module XsltInjectionFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/Security/CWE-094/Js2Py.ql b/python/ql/src/experimental/Security/CWE-094/Js2Py.ql index f5d6e3a6c10e..2bb3fea1b329 100644 --- a/python/ql/src/experimental/Security/CWE-094/Js2Py.ql +++ b/python/ql/src/experimental/Security/CWE-094/Js2Py.ql @@ -24,6 +24,8 @@ module Js2PyFlowConfig implements DataFlow::ConfigSig { API::moduleImport("js2py").getMember(["eval_js", "eval_js6", "EvalJs"]).getACall().getArg(_) = node } + + predicate observeDiffInformedIncrementalMode() { any() } } module Js2PyFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/Security/CWE-176/UnicodeBypassValidationQuery.qll b/python/ql/src/experimental/Security/CWE-176/UnicodeBypassValidationQuery.qll index f2c3b01ac30f..c0337117cf01 100644 --- a/python/ql/src/experimental/Security/CWE-176/UnicodeBypassValidationQuery.qll +++ b/python/ql/src/experimental/Security/CWE-176/UnicodeBypassValidationQuery.qll @@ -75,6 +75,8 @@ private module UnicodeBypassValidationConfig implements DataFlow::StateConfigSig ) and state instanceof PostValidation } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "Unicode transformation mishandling" vulnerabilities. */ diff --git a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.ql b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.ql index 82ba11c1d4ba..4c86b56d64f3 100644 --- a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.ql +++ b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.ql @@ -26,6 +26,8 @@ private module PossibleTimingAttackAgainstHashConfig implements DataFlow::Config predicate isSource(DataFlow::Node source) { source instanceof ProduceCryptoCall } predicate isSink(DataFlow::Node sink) { sink instanceof NonConstantTimeComparisonSink } + + predicate observeDiffInformedIncrementalMode() { any() } } module PossibleTimingAttackAgainstHashFlow = diff --git a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.ql b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.ql index e08f1dbb5177..dca14dacfd62 100644 --- a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.ql +++ b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.ql @@ -25,6 +25,8 @@ private module TimingAttackAgainstHashConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof ProduceCryptoCall } predicate isSink(DataFlow::Node sink) { sink instanceof NonConstantTimeComparisonSink } + + predicate observeDiffInformedIncrementalMode() { any() } } module TimingAttackAgainstHashFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.ql b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.ql index a1da41530a8f..c59885c23bb7 100644 --- a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.ql +++ b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.ql @@ -23,6 +23,8 @@ private module TimingAttackAgainstHeaderValueConfig implements DataFlow::ConfigS predicate isSource(DataFlow::Node source) { source instanceof ClientSuppliedSecret } predicate isSink(DataFlow::Node sink) { sink instanceof CompareSink } + + predicate observeDiffInformedIncrementalMode() { any() } } module TimingAttackAgainstHeaderValueFlow = diff --git a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.ql b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.ql index cdf350dd7cd2..af54b3c28794 100644 --- a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.ql +++ b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.ql @@ -23,6 +23,8 @@ private module PossibleTimingAttackAgainstSensitiveInfoConfig implements DataFlo predicate isSource(DataFlow::Node source) { source instanceof SecretSource } predicate isSink(DataFlow::Node sink) { sink instanceof NonConstantTimeComparisonSink } + + predicate observeDiffInformedIncrementalMode() { any() } } module PossibleTimingAttackAgainstSensitiveInfoFlow = diff --git a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.ql b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.ql index 8ec4fac97e32..c1afcb22e6b2 100644 --- a/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.ql +++ b/python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.ql @@ -24,6 +24,8 @@ private module TimingAttackAgainstSensitiveInfoConfig implements DataFlow::Confi predicate isSource(DataFlow::Node source) { source instanceof SecretSource } predicate isSink(DataFlow::Node sink) { sink instanceof NonConstantTimeComparisonSink } + + predicate observeDiffInformedIncrementalMode() { any() } } module TimingAttackAgainstSensitiveInfoFlow = diff --git a/python/ql/src/experimental/Security/CWE-287-ConstantSecretKey/WebAppConstantSecretKey.ql b/python/ql/src/experimental/Security/CWE-287-ConstantSecretKey/WebAppConstantSecretKey.ql index 7bb35012b389..f63f590ba376 100644 --- a/python/ql/src/experimental/Security/CWE-287-ConstantSecretKey/WebAppConstantSecretKey.ql +++ b/python/ql/src/experimental/Security/CWE-287-ConstantSecretKey/WebAppConstantSecretKey.ql @@ -52,6 +52,8 @@ private module WebAppConstantSecretKeyConfig implements DataFlow::StateConfigSig or state = Django() and DjangoConstantSecretKeyConfig::isSink(sink) } + + predicate observeDiffInformedIncrementalMode() { any() } } module WebAppConstantSecretKeyFlow = TaintTracking::GlobalWithState; diff --git a/python/ql/src/experimental/Security/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql b/python/ql/src/experimental/Security/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql index c548eac68364..a0fadbff3f3b 100644 --- a/python/ql/src/experimental/Security/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql +++ b/python/ql/src/experimental/Security/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql @@ -145,6 +145,8 @@ private module AzureBlobClientConfig implements DataFlow::StateConfigSig { node = call.getObject() ) } + + predicate observeDiffInformedIncrementalMode() { any() } } module AzureBlobClientFlow = DataFlow::GlobalWithState; diff --git a/python/ql/src/experimental/Security/CWE-340/TokenBuiltFromUUID.ql b/python/ql/src/experimental/Security/CWE-340/TokenBuiltFromUUID.ql index b91f2dd6237b..ab5a4243a746 100644 --- a/python/ql/src/experimental/Security/CWE-340/TokenBuiltFromUUID.ql +++ b/python/ql/src/experimental/Security/CWE-340/TokenBuiltFromUUID.ql @@ -51,6 +51,8 @@ private module TokenBuiltFromUuidConfig implements DataFlow::ConfigSig { nodeTo = call ) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "TokenBuiltFromUUID" vulnerabilities. */ diff --git a/python/ql/src/experimental/Security/CWE-346/CorsBypass.ql b/python/ql/src/experimental/Security/CWE-346/CorsBypass.ql index 4b79b97ff4a6..01e661cb0bbf 100644 --- a/python/ql/src/experimental/Security/CWE-346/CorsBypass.ql +++ b/python/ql/src/experimental/Security/CWE-346/CorsBypass.ql @@ -79,6 +79,8 @@ module CorsBypassConfig implements DataFlow::ConfigSig { c.getReturn().asSource() = node2 and n.asSource() = node1 ) } + + predicate observeDiffInformedIncrementalMode() { any() } } module CorsFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/Security/CWE-348/ClientSuppliedIpUsedInSecurityCheck.ql b/python/ql/src/experimental/Security/CWE-348/ClientSuppliedIpUsedInSecurityCheck.ql index 219192ce45db..463bf59c436c 100644 --- a/python/ql/src/experimental/Security/CWE-348/ClientSuppliedIpUsedInSecurityCheck.ql +++ b/python/ql/src/experimental/Security/CWE-348/ClientSuppliedIpUsedInSecurityCheck.ql @@ -45,6 +45,8 @@ private module ClientSuppliedIpUsedInSecurityCheckConfig implements DataFlow::Co ss = node.asExpr() ) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "client ip used in security check" vulnerabilities. */ diff --git a/python/ql/src/experimental/Security/CWE-770/UnicodeDoS.ql b/python/ql/src/experimental/Security/CWE-770/UnicodeDoS.ql index 47edf3ed0f92..61cdd34920de 100644 --- a/python/ql/src/experimental/Security/CWE-770/UnicodeDoS.ql +++ b/python/ql/src/experimental/Security/CWE-770/UnicodeDoS.ql @@ -108,6 +108,8 @@ private module UnicodeDoSConfig implements DataFlow::ConfigSig { .getACall() .getArg(_) } + + predicate observeDiffInformedIncrementalMode() { any() } } module UnicodeDoSFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/Security/UnsafeUnpackQuery.qll b/python/ql/src/experimental/Security/UnsafeUnpackQuery.qll index 338a5555c572..64da6b8d799a 100644 --- a/python/ql/src/experimental/Security/UnsafeUnpackQuery.qll +++ b/python/ql/src/experimental/Security/UnsafeUnpackQuery.qll @@ -208,6 +208,8 @@ module UnsafeUnpackConfig implements DataFlow::ConfigSig { nodeFrom = mcn.getArg(0) ) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "UnsafeUnpacking" vulnerabilities. */ diff --git a/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll b/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll index f174220727e2..de93bac0934a 100644 --- a/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll +++ b/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll @@ -38,6 +38,10 @@ module SmtpLib { predicate isSink(DataFlow::Node sink) { sink = smtpMimeMultipartInstance().getACall().getArgByName("_subparts") } + + predicate observeDiffInformedIncrementalMode() { + none() // Used in library model + } } module SmtpMessageFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/semmle/python/security/DecompressionBomb.qll b/python/ql/src/experimental/semmle/python/security/DecompressionBomb.qll index 552f901b7e0c..a2e50d0ade5d 100644 --- a/python/ql/src/experimental/semmle/python/security/DecompressionBomb.qll +++ b/python/ql/src/experimental/semmle/python/security/DecompressionBomb.qll @@ -408,6 +408,8 @@ module BombsConfig implements DataFlow::ConfigSig { isAdditionalTaintStepTextIOWrapper(pred, succ) ) } + + predicate observeDiffInformedIncrementalMode() { any() } } module BombsFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/semmle/python/security/InsecureRandomness.qll b/python/ql/src/experimental/semmle/python/security/InsecureRandomness.qll index 5a32a887bd5b..8bc09a7036ed 100644 --- a/python/ql/src/experimental/semmle/python/security/InsecureRandomness.qll +++ b/python/ql/src/experimental/semmle/python/security/InsecureRandomness.qll @@ -27,6 +27,8 @@ module InsecureRandomness { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "random values that are not cryptographically secure" vulnerabilities. */ diff --git a/python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qll b/python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qll index a63332137d19..630543e6f798 100644 --- a/python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qll +++ b/python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qll @@ -101,6 +101,8 @@ private module LdapInsecureAuthConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { exists(LdapBind ldapBind | not ldapBind.useSsl() and sink = ldapBind.getHost()) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "LDAP insecure authentications" vulnerabilities. */ diff --git a/python/ql/src/experimental/semmle/python/security/RemoteCommandExecution.qll b/python/ql/src/experimental/semmle/python/security/RemoteCommandExecution.qll index f4eed84c0c1c..6f4ea88a7472 100644 --- a/python/ql/src/experimental/semmle/python/security/RemoteCommandExecution.qll +++ b/python/ql/src/experimental/semmle/python/security/RemoteCommandExecution.qll @@ -10,6 +10,8 @@ module RemoteCommandExecutionConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource } predicate isSink(DataFlow::Node sink) { sink = any(RemoteCommandExecution rce).getCommand() } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "secondary server command injection" vulnerabilities. */ diff --git a/python/ql/src/experimental/semmle/python/security/TimingAttack.qll b/python/ql/src/experimental/semmle/python/security/TimingAttack.qll index 6d8cc98f21ce..e20e78853529 100644 --- a/python/ql/src/experimental/semmle/python/security/TimingAttack.qll +++ b/python/ql/src/experimental/semmle/python/security/TimingAttack.qll @@ -271,6 +271,12 @@ module UserInputSecretConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource } predicate isSink(DataFlow::Node sink) { sink.asExpr() instanceof CredentialExpr } + + predicate observeDiffInformedIncrementalMode() { + // TODO(diff-informed): Manually verify if config can be diff-informed. + // ql/src/experimental/semmle/python/security/TimingAttack.qll:176: Flow call outside 'select' clause + none() + } } module UserInputSecretFlow = TaintTracking::Global; @@ -288,6 +294,12 @@ module UserInputInComparisonConfig implements DataFlow::ConfigSig { sink.asExpr() = [left, right] ) } + + predicate observeDiffInformedIncrementalMode() { + // TODO(diff-informed): Manually verify if config can be diff-informed. + // ql/src/experimental/semmle/python/security/TimingAttack.qll:165: Flow call outside 'select' clause + none() + } } module UserInputInComparisonFlow = TaintTracking::Global; @@ -304,6 +316,12 @@ private module ExcludeLenFuncConfig implements DataFlow::ConfigSig { sink.asExpr() = call.getArg(0) ) } + + predicate observeDiffInformedIncrementalMode() { + // TODO(diff-informed): Manually verify if config can be diff-informed. + // ql/src/experimental/semmle/python/security/TimingAttack.qll:347: Flow call outside 'select' clause + none() + } } module ExcludeLenFuncFlow = TaintTracking::Global; diff --git a/python/ql/src/experimental/semmle/python/security/ZipSlip.qll b/python/ql/src/experimental/semmle/python/security/ZipSlip.qll index 5f8b4d940ef8..a6125015db01 100644 --- a/python/ql/src/experimental/semmle/python/security/ZipSlip.qll +++ b/python/ql/src/experimental/semmle/python/security/ZipSlip.qll @@ -34,6 +34,8 @@ private module ZipSlipConfig implements DataFlow::ConfigSig { ) and not sink.getScope().getLocation().getFile().inStdlib() } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "zip slip" vulnerabilities. */ diff --git a/python/ql/src/experimental/semmle/python/security/dataflow/EmailXss.qll b/python/ql/src/experimental/semmle/python/security/dataflow/EmailXss.qll index c08a0e6b258b..8f392a43a8a3 100644 --- a/python/ql/src/experimental/semmle/python/security/dataflow/EmailXss.qll +++ b/python/ql/src/experimental/semmle/python/security/dataflow/EmailXss.qll @@ -34,6 +34,8 @@ private module EmailXssConfig implements DataFlow::ConfigSig { nodeFrom = htmlContentCall.getArg(0) ) } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global taint-tracking for detecting "Email XSS" vulnerabilities. */ diff --git a/python/ql/src/experimental/semmle/python/security/injection/CsvInjection.qll b/python/ql/src/experimental/semmle/python/security/injection/CsvInjection.qll index d08e9b090a6f..859f6d1e5e80 100644 --- a/python/ql/src/experimental/semmle/python/security/injection/CsvInjection.qll +++ b/python/ql/src/experimental/semmle/python/security/injection/CsvInjection.qll @@ -17,6 +17,8 @@ private module CsvInjectionConfig implements DataFlow::ConfigSig { node = DataFlow::BarrierGuard::getABarrierNode() or node instanceof ConstCompareBarrier } + + predicate observeDiffInformedIncrementalMode() { any() } } private predicate startsWithCheck(DataFlow::GuardNode g, ControlFlowNode node, boolean branch) { diff --git a/python/ql/src/semmle/python/functions/ModificationOfParameterWithDefault.qll b/python/ql/src/semmle/python/functions/ModificationOfParameterWithDefault.qll index 290087f6a71c..d0d2580e7676 100644 --- a/python/ql/src/semmle/python/functions/ModificationOfParameterWithDefault.qll +++ b/python/ql/src/semmle/python/functions/ModificationOfParameterWithDefault.qll @@ -50,6 +50,8 @@ module ModificationOfParameterWithDefault { or node.(DataFlow::MethodCallNode).calls(_, "copy") } + + predicate observeDiffInformedIncrementalMode() { any() } } /** Global data-flow for detecting modifications of a parameters default value. */