File tree Expand file tree Collapse file tree 3 files changed +6
-19
lines changed
src/queries/Security/CWE-079 Expand file tree Collapse file tree 3 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ class ApplyExprCfgNode extends ExprCfgNode {
125
125
}
126
126
127
127
AbstractFunctionDecl getStaticTarget ( ) { result = e .getStaticTarget ( ) }
128
+
129
+ Expr getFunction ( ) { result = e .getFunction ( ) }
128
130
}
129
131
130
132
class CallExprCfgNode extends ApplyExprCfgNode {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ private import FlowSummaryImpl::Private
11
11
private import FlowSummaryImpl:: Public
12
12
private import codeql.swift.dataflow.ExternalFlow
13
13
private import codeql.swift.dataflow.FlowSummary as FlowSummary
14
+ private import codeql.swift.controlflow.CfgNodes
14
15
15
16
class SummarizedCallableBase = AbstractFunctionDecl ;
16
17
@@ -153,7 +154,9 @@ class InterpretNode extends TInterpretNode {
153
154
DataFlowCallable asCallable ( ) { result .getUnderlyingCallable ( ) = this .asElement ( ) }
154
155
155
156
/** Gets the target of this call, if any. */
156
- AbstractFunctionDecl getCallTarget ( ) { result = this .asCall ( ) .asCall ( ) .getStaticTarget ( ) }
157
+ AbstractFunctionDecl getCallTarget ( ) {
158
+ result = this .asCall ( ) .asCall ( ) .getFunction ( ) .( ApplyExpr ) .getStaticTarget ( )
159
+ }
157
160
158
161
/** Gets a textual representation of this node. */
159
162
string toString ( ) {
Original file line number Diff line number Diff line change @@ -17,24 +17,6 @@ import codeql.swift.dataflow.DataFlow
17
17
import codeql.swift.dataflow.TaintTracking
18
18
import codeql.swift.dataflow.FlowSources
19
19
import DataFlow:: PathGraph
20
- import codeql.swift.frameworks.StandardLibrary.String
21
-
22
- /**
23
- * A taint source that is `String(contentsOf:)`.
24
- * TODO: this shouldn't be needed when `StringSource` in `String.qll` is working.
25
- */
26
- class StringContentsOfUrlSource extends RemoteFlowSource {
27
- StringContentsOfUrlSource ( ) {
28
- exists ( CallExpr call , AbstractFunctionDecl f |
29
- call .getFunction ( ) .( ApplyExpr ) .getStaticTarget ( ) = f and
30
- f .getName ( ) = "init(contentsOf:)" and
31
- f .getParam ( 0 ) .getType ( ) .getName ( ) = "URL" and
32
- this .asExpr ( ) = call
33
- )
34
- }
35
-
36
- override string getSourceType ( ) { result = "" }
37
- }
38
20
39
21
/**
40
22
* A sink that is a candidate result for this query, such as certain arguments
You can’t perform that action at this time.
0 commit comments