diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ContentDataFlow.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ContentDataFlow.qll index e9cd7373975a..76936549051a 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ContentDataFlow.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ContentDataFlow.qll @@ -109,6 +109,8 @@ module Global { DataFlow::FlowFeature getAFeature() { result = ContentConfig::getAFeature() } + predicate accessPathLimit = ContentConfig::accessPathLimit/0; + // needed to record reads/stores inside summarized callables predicate includeHiddenNodes() { any() } } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl1.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl1.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 9c19e5b9cbbc..0a22178d108e 100644 --- a/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -72,11 +72,11 @@ string captureQualifierFlow(TargetApiSpecific api) { result = ModelPrinting::asValueModel(api, qualifierString(), "ReturnValue") } -private int accessPathLimit() { result = 2 } +private int accessPathLimit0() { result = 2 } private newtype TTaintState = - TTaintRead(int n) { n in [0 .. accessPathLimit()] } or - TTaintStore(int n) { n in [1 .. accessPathLimit()] } + TTaintRead(int n) { n in [0 .. accessPathLimit0()] } or + TTaintStore(int n) { n in [1 .. accessPathLimit0()] } abstract private class TaintState extends TTaintState { abstract string toString(); diff --git a/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl1.qll b/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl1.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll b/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl1.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl1.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 9c19e5b9cbbc..0a22178d108e 100644 --- a/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -72,11 +72,11 @@ string captureQualifierFlow(TargetApiSpecific api) { result = ModelPrinting::asValueModel(api, qualifierString(), "ReturnValue") } -private int accessPathLimit() { result = 2 } +private int accessPathLimit0() { result = 2 } private newtype TTaintState = - TTaintRead(int n) { n in [0 .. accessPathLimit()] } or - TTaintStore(int n) { n in [1 .. accessPathLimit()] } + TTaintRead(int n) { n in [0 .. accessPathLimit0()] } or + TTaintStore(int n) { n in [1 .. accessPathLimit0()] } abstract private class TaintState extends TTaintState { abstract string toString(); diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl1.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl1.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) { diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 6a18c1666134..6b14d3d2e06a 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -376,6 +376,9 @@ module Configs { */ default int fieldFlowBranchLimit() { result = 2 } + /** Gets the access path limit. */ + default int accessPathLimit() { result = Lang::accessPathLimit() } + /** * Gets a data flow configuration feature to add restrictions to the set of * valid flow paths. @@ -495,6 +498,9 @@ module Configs { */ default int fieldFlowBranchLimit() { result = 2 } + /** Gets the access path limit. */ + default int accessPathLimit() { result = Lang::accessPathLimit() } + /** * Gets a data flow configuration feature to add restrictions to the set of * valid flow paths. @@ -583,6 +589,8 @@ module DataFlowMake { private module C implements FullStateConfigSig { import DefaultState import Config + + predicate accessPathLimit = Config::accessPathLimit/0; } import Impl @@ -599,6 +607,8 @@ module DataFlowMake { module GlobalWithState implements GlobalFlowSig { private module C implements FullStateConfigSig { import Config + + predicate accessPathLimit = Config::accessPathLimit/0; } import Impl diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index d555b281710c..e075af108d1c 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -93,6 +93,9 @@ module MakeImpl { */ int fieldFlowBranchLimit(); + /** Gets the access path limit. */ + int accessPathLimit(); + /** * Gets a data flow configuration feature to add restrictions to the set of * valid flow paths. @@ -477,7 +480,9 @@ module MakeImpl { /** * Holds if field flow should be used for the given configuration. */ - private predicate useFieldFlow() { Config::fieldFlowBranchLimit() >= 1 } + private predicate useFieldFlow() { + Config::fieldFlowBranchLimit() >= 1 and Config::accessPathLimit() > 0 + } private predicate hasSourceCallCtx() { exists(FlowFeature feature | feature = Config::getAFeature() | @@ -2522,7 +2527,10 @@ module MakeImpl { bindingset[c, t, tail] Ap apCons(Content c, Typ t, Ap tail) { - result = true and exists(c) and exists(t) and exists(tail) + result = true and + exists(c) and + exists(t) and + if tail = true then Config::accessPathLimit() > 1 else any() } class ApHeadContent = Unit; @@ -3026,11 +3034,11 @@ module MakeImpl { } or TConsCons(Content c1, DataFlowType t, Content c2, int len) { Stage4::consCand(c1, t, TFrontHead(c2)) and - len in [2 .. accessPathLimit()] and + len in [2 .. Config::accessPathLimit()] and not expensiveLen2unfolding(c1) } or TCons1(Content c, int len) { - len in [1 .. accessPathLimit()] and + len in [1 .. Config::accessPathLimit()] and expensiveLen2unfolding(c) } @@ -4626,7 +4634,7 @@ module MakeImpl { private newtype TPartialAccessPath = TPartialNil() or - TPartialCons(Content c, int len) { len in [1 .. accessPathLimit()] } + TPartialCons(Content c, int len) { len in [1 .. Config::accessPathLimit()] } /** * Conceptually a list of `Content`s, but only the first diff --git a/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl1.qll b/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl1.qll index 2bbc565daa6b..9b92f961e6f1 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl1.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl1.qll @@ -285,6 +285,8 @@ deprecated private module Config implements FullStateConfigSig { int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) } + int accessPathLimit() { result = 5 } + FlowFeature getAFeature() { result = any(Configuration config).getAFeature() } predicate sourceGrouping(Node source, string sourceGroup) {