Skip to content

Commit 8913c63

Browse files
committed
Fix various compilation issues.
1 parent 20ef757 commit 8913c63

File tree

18 files changed

+22
-111
lines changed

18 files changed

+22
-111
lines changed

csharp/src/audit/explore/Dependencies.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
private import csharp
1111
private import semmle.code.csharp.dispatch.Dispatch
12-
private import Telemetry.ExternalApi
12+
private import semmle.code.csharp.telemetry.ExternalApi
1313

1414
private predicate getRelevantUsages(string namespace, int usages) {
1515
usages =

csharp/src/library_sources/ExternalAPIsQuery.qll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,6 @@ class ExternalApiDataNode extends DataFlow::Node {
9898
}
9999
}
100100

101-
/**
102-
* DEPRECATED: Use `RemoteSourceToExternalApi` instead.
103-
*
104-
* A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s.
105-
*/
106-
deprecated class UntrustedDataToExternalApiConfig extends TaintTracking::Configuration {
107-
UntrustedDataToExternalApiConfig() { this = "UntrustedDataToExternalAPIConfig" }
108-
109-
override predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
110-
111-
override predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
112-
}
113-
114101
/** A configuration for tracking flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s. */
115102
private module RemoteSourceToExternalApiConfig implements DataFlow::ConfigSig {
116103
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }

csharp/src/security/dataflow/flowsources/AuthCookie.qll

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -114,61 +114,6 @@ Expr getAValueForProp(ObjectCreation create, Assignment a, string prop) {
114114
*/
115115
predicate isPropertySet(ObjectCreation oc, string prop) { exists(getAValueForProp(oc, _, prop)) }
116116

117-
/**
118-
* Tracks if a callback used in `OnAppendCookie` sets a cookie property to `true`.
119-
*/
120-
abstract deprecated private class OnAppendCookieTrackingConfig extends DataFlow::Configuration {
121-
bindingset[this]
122-
OnAppendCookieTrackingConfig() { any() }
123-
124-
/**
125-
* Specifies the cookie property name to track.
126-
*/
127-
abstract string propertyName();
128-
129-
override predicate isSource(DataFlow::Node source) {
130-
exists(PropertyWrite pw, Assignment delegateAssign, Callable c |
131-
pw.getProperty().getName() = "OnAppendCookie" and
132-
pw.getProperty().getDeclaringType() instanceof MicrosoftAspNetCoreBuilderCookiePolicyOptions and
133-
delegateAssign.getLValue() = pw and
134-
(
135-
exists(LambdaExpr lambda |
136-
delegateAssign.getRValue() = lambda and
137-
lambda = c
138-
)
139-
or
140-
exists(DelegateCreation delegate |
141-
delegateAssign.getRValue() = delegate and
142-
delegate.getArgument().(CallableAccess).getTarget() = c
143-
)
144-
) and
145-
c.getParameter(0) = source.asParameter()
146-
)
147-
}
148-
149-
override predicate isSink(DataFlow::Node sink) {
150-
exists(PropertyWrite pw, Assignment a |
151-
pw.getProperty().getDeclaringType() instanceof MicrosoftAspNetCoreHttpCookieOptions and
152-
pw.getProperty().getName() = this.propertyName() and
153-
a.getLValue() = pw and
154-
exists(Expr val |
155-
DataFlow::localExprFlow(val, a.getRValue()) and
156-
val.getValue() = "true"
157-
) and
158-
sink.asExpr() = pw.getQualifier()
159-
)
160-
}
161-
162-
override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
163-
node2.asExpr() =
164-
any(PropertyRead pr |
165-
pr.getQualifier() = node1.asExpr() and
166-
pr.getProperty().getDeclaringType() instanceof
167-
MicrosoftAspNetCoreCookiePolicyAppendCookieContext
168-
)
169-
}
170-
}
171-
172117
private signature string propertyName();
173118

174119
/**

java/lib/ghsl/Encoding.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import java
22
import semmle.code.java.dataflow.DataFlow
33
import semmle.code.java.dataflow.FlowSources
4-
import semmle.code.java.dataflow.TaintTracking2
54

65
module Base64 {
76
abstract class Encoding extends DataFlow::Node { }

java/lib/ghsl/Logging.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import java
22
import semmle.code.java.dataflow.DataFlow
33
import semmle.code.java.dataflow.FlowSources
4-
import semmle.code.java.dataflow.TaintTracking2
54

65
abstract class LoggingMethodsSinks extends DataFlow::Node { }
76

java/lib/ghsl/SensitiveInformation.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import java
22
import semmle.code.java.dataflow.DataFlow
33
import semmle.code.java.dataflow.FlowSources
4-
import semmle.code.java.dataflow.TaintTracking2
54

65
abstract class SensitiveInformationSources extends DataFlow::Node { }
76

java/lib/semmle/code/java/security/SpringUrlRedirect.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private class SpringViewUrlRedirectSink extends SpringUrlRedirectSink {
5353
)
5454
or
5555
exists(MethodCall ma, RedirectAppendCall rac |
56-
DataFlow2::localExprFlow(rac.getQualifier(), ma.getQualifier()) and
56+
DataFlow::localExprFlow(rac.getQualifier(), ma.getQualifier()) and
5757
ma.getMethod().hasName("append") and
5858
ma.getArgument(0) = this.asExpr() and
5959
any(SpringRequestMappingMethod sqmm).polyCalls*(this.getEnclosingCallable())

java/src/audit/CWE-079/XSSJSPLenient.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import java
1515
import semmle.code.java.dataflow.FlowSources
16-
import semmle.code.java.dataflow.TaintTracking2
1716
import semmle.code.java.security.XSS
1817
import semmle.code.java.frameworks.Servlets
1918
import JSPLocations
@@ -106,10 +105,11 @@ class JSPTaintStep extends XssAdditionalTaintStep {
106105
exists(EvalCall propEval, AddAttrCall addAttr |
107106
varAppearsInEvalExpr(addAttr.getAttrName(), propEval.getEvalString()) and
108107
(
109-
exists(RedirectToJsp rtj | rtj.(ControlFlowNode).getAPredecessor*() = addAttr)
108+
exists(RedirectToJsp rtj | rtj.getControlFlowNode().getAPredecessor*().asExpr() = addAttr)
110109
implies
111110
propEval.getFile() =
112-
any(RedirectToJsp rtj | rtj.(ControlFlowNode).getAPredecessor*() = addAttr).getJspFile()
111+
any(RedirectToJsp rtj | rtj.getControlFlowNode().getAPredecessor*().asExpr() = addAttr)
112+
.getJspFile()
113113
)
114114
|
115115
node1.asExpr() = addAttr.getAttrValue() and
@@ -129,11 +129,11 @@ class ForEachStep extends XssAdditionalTaintStep {
129129
v.getType().getName() = "ForEachTag" and
130130
exists(DataFlow::Node ctxSrc |
131131
ContextFlow::ContextFlow::flow(ctxSrc,
132-
DataFlow2::exprNode(methodCallOn("setPageContext", v).getArgument(0))) and
133-
ContextFlow::ContextFlow::flow(ctxSrc, DataFlow2::exprNode(eval.getCtxExpr()))
132+
DataFlow::exprNode(methodCallOn("setPageContext", v).getArgument(0))) and
133+
ContextFlow::ContextFlow::flow(ctxSrc, DataFlow::exprNode(eval.getCtxExpr()))
134134
// config
135-
// .hasFlow(ctxSrc, DataFlow2::exprNode(methodCallOn("setPageContext", v).getArgument(0))) and
136-
// config.hasFlow(ctxSrc, DataFlow2::exprNode(eval.getCtxExpr()))
135+
// .hasFlow(ctxSrc, DataFlow::exprNode(methodCallOn("setPageContext", v).getArgument(0))) and
136+
// config.hasFlow(ctxSrc, DataFlow::exprNode(eval.getCtxExpr()))
137137
) and
138138
node1.asExpr() = methodCallOn("setItems", v).getArgument(0) and
139139
node2.asExpr() = eval and
@@ -169,7 +169,7 @@ class RedirectToJsp extends ReturnStmt {
169169
File jsp;
170170

171171
RedirectToJsp() {
172-
exists(DataFlow2::Node strLit, DataFlow2::Node retVal |
172+
exists(DataFlow::Node strLit, DataFlow::Node retVal |
173173
strLit.asExpr().(StringLiteral).getValue().splitAt("/") + "_jsp.java" = jsp.getBaseName()
174174
|
175175
retVal.asExpr() = this.getResult() and LiteralConfig::LiteralFlow::flow(strLit, retVal)

java/src/library_sources/ExternalAPIs.qll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,6 @@ class ExternalApiDataNode extends DataFlow::Node {
9797
string getMethodDescription() { result = this.getMethod().getQualifiedName() }
9898
}
9999

100-
/**
101-
* DEPRECATED: Use `UntrustedDataToExternalApiFlow` instead.
102-
*
103-
* A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s.
104-
*/
105-
deprecated class UntrustedDataToExternalApiConfig extends TaintTracking::Configuration {
106-
UntrustedDataToExternalApiConfig() { this = "UntrustedDataToExternalAPIConfig" }
107-
108-
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
109-
110-
override predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
111-
}
112-
113100
/**
114101
* Taint tracking configuration for flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s.
115102
*/

java/src/security/CWE-079/XSSJSP.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import java
1414
import semmle.code.java.dataflow.FlowSources
15-
import semmle.code.java.dataflow.TaintTracking2
1615
import semmle.code.java.security.XSS
1716
import JSPLocations
1817

@@ -48,10 +47,11 @@ class JSPTaintStep extends XssAdditionalTaintStep {
4847
.getValue()
4948
.regexpMatch(".*\\$\\{" + key.getValue() + "\\}.*") and
5049
(
51-
exists(RedirectToJsp rtj | rtj.(ControlFlowNode).getAPredecessor*() = addAttr)
50+
exists(RedirectToJsp rtj | rtj.getControlFlowNode().getAPredecessor*().asExpr() = addAttr)
5251
implies
5352
propEval.getFile() =
54-
any(RedirectToJsp rtj | rtj.(ControlFlowNode).getAPredecessor*() = addAttr).getJspFile()
53+
any(RedirectToJsp rtj | rtj.getControlFlowNode().getAPredecessor*().asExpr() = addAttr)
54+
.getJspFile()
5555
)
5656
|
5757
node1.asExpr() = addAttr.getArgument(1) and
@@ -74,7 +74,7 @@ class RedirectToJsp extends ReturnStmt {
7474
File jsp;
7575

7676
RedirectToJsp() {
77-
exists(DataFlow2::Node strLit, DataFlow2::Node retVal |
77+
exists(DataFlow::Node strLit, DataFlow::Node retVal |
7878
strLit.asExpr().(StringLiteral).getValue().splitAt("/") + "_jsp.java" = jsp.getBaseName()
7979
|
8080
retVal.asExpr() = this.getResult() and LiteralConfig::LiteralFlow::flow(strLit, retVal)

0 commit comments

Comments
 (0)