Skip to content

Commit e7bad4c

Browse files
committed
Refactor to DataFlow::Global
1 parent 899200a commit e7bad4c

28 files changed

+37
-37
lines changed

java/ql/lib/semmle/code/java/security/GroovyInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ module GroovyInjectionConfig implements DataFlow::ConfigSig {
4141
* Detect taint flow of unsafe user input
4242
* that is used to evaluate a Groovy expression.
4343
*/
44-
module GroovyInjectionFlow = TaintTracking::Make<GroovyInjectionConfig>;
44+
module GroovyInjectionFlow = TaintTracking::Global<GroovyInjectionConfig>;

java/ql/lib/semmle/code/java/security/JexlInjectionQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module JexlInjectionConfig implements DataFlow::ConfigSig {
7676
* Tracks unsafe user input that is used to construct and evaluate a JEXL expression.
7777
* It supports both JEXL 2 and 3.
7878
*/
79-
module JexlInjectionFlow = TaintTracking::Make<JexlInjectionConfig>;
79+
module JexlInjectionFlow = TaintTracking::Global<JexlInjectionConfig>;
8080

8181
/**
8282
* Holds if `n1` to `n2` is a dataflow step that creates a JEXL script using an unsafe engine
@@ -122,7 +122,7 @@ private predicate createJexlTemplateStep(DataFlow::Node n1, DataFlow::Node n2) {
122122
/**
123123
* Holds if `expr` is a JEXL engine that is configured with a sandbox.
124124
*/
125-
private predicate isSafeEngine(Expr expr) { SandboxedJexlFlow::hasFlowToExpr(expr) }
125+
private predicate isSafeEngine(Expr expr) { SandboxedJexlFlow::flowToExpr(expr) }
126126

127127
/**
128128
* A configuration for tracking sandboxed JEXL engines.
@@ -145,7 +145,7 @@ private module SandboxedJexlFlowConfig implements DataFlow::ConfigSig {
145145
}
146146
}
147147

148-
private module SandboxedJexlFlow = DataFlow::Make<SandboxedJexlFlowConfig>;
148+
private module SandboxedJexlFlow = DataFlow::Global<SandboxedJexlFlowConfig>;
149149

150150
/**
151151
* Defines a data flow source for JEXL engines configured with a sandbox.

java/ql/lib/semmle/code/java/security/JndiInjectionQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ module JndiInjectionFlowConfig implements DataFlow::ConfigSig {
4747
}
4848

4949
/** Tracks flow of unvalidated user input that is used in JNDI lookup */
50-
module JndiInjectionFlow = TaintTracking::Make<JndiInjectionFlowConfig>;
50+
module JndiInjectionFlow = TaintTracking::Global<JndiInjectionFlowConfig>;
5151

5252
/**
5353
* A method that does a JNDI lookup when it receives a `SearchControls` argument with `setReturningObjFlag` = `true`
5454
*/
5555
private class UnsafeSearchControlsSink extends JndiInjectionSink {
5656
UnsafeSearchControlsSink() {
57-
exists(MethodAccess ma | UnsafeSearchControlsFlow::hasFlowToExpr(ma.getAnArgument()) |
57+
exists(MethodAccess ma | UnsafeSearchControlsFlow::flowToExpr(ma.getAnArgument()) |
5858
this.asExpr() = ma.getArgument(0)
5959
)
6060
}
@@ -70,7 +70,7 @@ private module UnsafeSearchControlsConfig implements DataFlow::ConfigSig {
7070
predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeSearchControlsArgument }
7171
}
7272

73-
private module UnsafeSearchControlsFlow = DataFlow::Make<UnsafeSearchControlsConfig>;
73+
private module UnsafeSearchControlsFlow = DataFlow::Global<UnsafeSearchControlsConfig>;
7474

7575
/**
7676
* An argument of type `SearchControls` of an `LdapOperations.search` or `DirContext.search` call.

java/ql/lib/semmle/code/java/security/MvelInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ module MvelInjectionFlowConfig implements DataFlow::ConfigSig {
4444
}
4545

4646
/** Tracks flow of unsafe user input that is used to construct and evaluate a MVEL expression. */
47-
module MvelInjectionFlow = TaintTracking::Make<MvelInjectionFlowConfig>;
47+
module MvelInjectionFlow = TaintTracking::Global<MvelInjectionFlowConfig>;

java/ql/lib/semmle/code/java/security/OgnlInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ module OgnlInjectionFlowConfig implements DataFlow::ConfigSig {
4343
}
4444

4545
/** Tracks flow of unvalidated user input that is used in OGNL EL evaluation. */
46-
module OgnlInjectionFlow = TaintTracking::Make<OgnlInjectionFlowConfig>;
46+
module OgnlInjectionFlow = TaintTracking::Global<OgnlInjectionFlowConfig>;

java/ql/lib/semmle/code/java/security/SpelInjectionQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ module SpelInjectionConfig implements DataFlow::ConfigSig {
3939
}
4040

4141
/** Tracks flow of unsafe user input that is used to construct and evaluate a SpEL expression. */
42-
module SpelInjectionFlow = TaintTracking::Make<SpelInjectionConfig>;
42+
module SpelInjectionFlow = TaintTracking::Global<SpelInjectionConfig>;
4343

4444
/** Default sink for SpEL injection vulnerabilities. */
4545
private class DefaultSpelExpressionEvaluationSink extends SpelExpressionEvaluationSink {
4646
DefaultSpelExpressionEvaluationSink() {
4747
exists(MethodAccess ma |
4848
ma.getMethod() instanceof ExpressionEvaluationMethod and
4949
ma.getQualifier() = this.asExpr() and
50-
not SafeEvaluationContextFlow::hasFlowToExpr(ma.getArgument(0))
50+
not SafeEvaluationContextFlow::flowToExpr(ma.getArgument(0))
5151
)
5252
}
5353
}
@@ -68,7 +68,7 @@ private module SafeEvaluationContextFlowConfig implements DataFlow::ConfigSig {
6868
int fieldFlowBranchLimit() { result = 0 }
6969
}
7070

71-
private module SafeEvaluationContextFlow = DataFlow::Make<SafeEvaluationContextFlowConfig>;
71+
private module SafeEvaluationContextFlow = DataFlow::Global<SafeEvaluationContextFlowConfig>;
7272

7373
/**
7474
* A `ContextSource` that is safe from SpEL injection.

java/ql/lib/semmle/code/java/security/SqlInjectionQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module QueryInjectionFlowConfig implements DataFlow::ConfigSig {
5353
}
5454

5555
/** Tracks flow of unvalidated user input that is used in SQL queries. */
56-
module QueryInjectionFlow = TaintTracking::Make<QueryInjectionFlowConfig>;
56+
module QueryInjectionFlow = TaintTracking::Global<QueryInjectionFlowConfig>;
5757

5858
/**
5959
* Implementation of `SqlTainted.ql`. This is extracted to a QLL so that it
@@ -62,5 +62,5 @@ module QueryInjectionFlow = TaintTracking::Make<QueryInjectionFlowConfig>;
6262
predicate queryTaintedBy(
6363
QueryInjectionSink query, QueryInjectionFlow::PathNode source, QueryInjectionFlow::PathNode sink
6464
) {
65-
QueryInjectionFlow::hasFlowPath(source, sink) and sink.getNode() = query
65+
QueryInjectionFlow::flowPath(source, sink) and sink.getNode() = query
6666
}

java/ql/lib/semmle/code/java/security/TemplateInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ module TemplateInjectionFlowConfig implements DataFlow::StateConfigSig {
7171
}
7272

7373
/** Tracks server-side template injection (SST) vulnerabilities */
74-
module TemplateInjectionFlow = TaintTracking::MakeWithState<TemplateInjectionFlowConfig>;
74+
module TemplateInjectionFlow = TaintTracking::GlobalWithState<TemplateInjectionFlowConfig>;

java/ql/lib/semmle/code/java/security/XsltInjectionQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module XsltInjectionFlowConfig implements DataFlow::ConfigSig {
4747
/**
4848
* Tracks flow from unvalidated user input to XSLT transformation.
4949
*/
50-
module XsltInjectionFlow = TaintTracking::Make<XsltInjectionFlowConfig>;
50+
module XsltInjectionFlow = TaintTracking::Global<XsltInjectionFlowConfig>;
5151

5252
/**
5353
* A set of additional taint steps to consider when taint tracking XSLT related data flows.
@@ -70,7 +70,7 @@ private predicate newTransformerOrTemplatesStep(DataFlow::Node n1, DataFlow::Nod
7070
n2.asExpr() = ma and
7171
m.getDeclaringType() instanceof TransformerFactory and
7272
m.hasName(["newTransformer", "newTemplates"]) and
73-
not TransformerFactoryWithSecureProcessingFeatureFlow::hasFlowToExpr(ma.getQualifier())
73+
not TransformerFactoryWithSecureProcessingFeatureFlow::flowToExpr(ma.getQualifier())
7474
)
7575
}
7676

@@ -99,7 +99,7 @@ private module TransformerFactoryWithSecureProcessingFeatureFlowConfig implement
9999
}
100100

101101
private module TransformerFactoryWithSecureProcessingFeatureFlow =
102-
DataFlow::Make<TransformerFactoryWithSecureProcessingFeatureFlowConfig>;
102+
DataFlow::Global<TransformerFactoryWithSecureProcessingFeatureFlowConfig>;
103103

104104
/** A `ParserConfig` specific to `TransformerFactory`. */
105105
private class TransformerFactoryFeatureConfig extends ParserConfig {

java/ql/lib/semmle/code/java/security/regexp/RegexInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ module RegexInjectionConfig implements DataFlow::ConfigSig {
3131
predicate isBarrier(DataFlow::Node node) { node instanceof RegexInjectionSanitizer }
3232
}
3333

34-
module RegexInjectionFlow = TaintTracking::Make<RegexInjectionConfig>;
34+
module RegexInjectionFlow = TaintTracking::Global<RegexInjectionConfig>;

0 commit comments

Comments
 (0)