Skip to content

Commit 5375678

Browse files
committed
Swift: Add consistent CSV extension points.
1 parent 6a210d7 commit 5375678

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

swift/ql/lib/codeql/swift/security/CleartextLoggingExtensions.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class CleartextLoggingAdditionalTaintStep extends Unit {
2525
abstract predicate step(DataFlow::Node n1, DataFlow::Node n2);
2626
}
2727

28+
/**
29+
* A sink defined in a CSV model.
30+
*/
2831
private class DefaultCleartextLoggingSink extends CleartextLoggingSink {
2932
DefaultCleartextLoggingSink() { sinkNode(this, "logging") }
3033
}

swift/ql/lib/codeql/swift/security/PathInjectionExtensions.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class PathInjectionAdditionalTaintStep extends Unit {
2929
abstract predicate step(DataFlow::Node node1, DataFlow::Node node2);
3030
}
3131

32+
/**
33+
* A sink defined in a CSV model.
34+
*/
3235
private class DefaultPathInjectionSink extends PathInjectionSink {
3336
DefaultPathInjectionSink() { sinkNode(this, "path-injection") }
3437
}

swift/ql/lib/codeql/swift/security/PredicateInjectionExtensions.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class PredicateInjectionAdditionalTaintStep extends Unit {
2424
abstract predicate step(DataFlow::Node n1, DataFlow::Node n2);
2525
}
2626

27+
/**
28+
* A sink defined in a CSV model.
29+
*/
2730
private class DefaultPredicateInjectionSink extends PredicateInjectionSink {
2831
DefaultPredicateInjectionSink() { sinkNode(this, "predicate-injection") }
2932
}

swift/ql/lib/codeql/swift/security/UncontrolledFormatStringExtensions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private class DefaultUncontrolledFormatStringSink extends UncontrolledFormatStri
3434
// the format argument to a `FormattingFunctionCall`.
3535
this.asExpr() = any(FormattingFunctionCall fc).getFormat()
3636
or
37-
// a sink defined in a Csv model.
37+
// a sink defined in a CSV model.
3838
sinkNode(this, "uncontrolled-format-string")
3939
}
4040
}

swift/ql/lib/codeql/swift/security/XXEExtensions.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import swift
44
private import codeql.swift.dataflow.DataFlow
55
private import codeql.swift.frameworks.AEXML
66
private import codeql.swift.frameworks.Libxml2
7+
private import codeql.swift.dataflow.ExternalFlow
78

89
/** A data flow sink for XML external entities (XXE) vulnerabilities. */
910
abstract class XxeSink extends DataFlow::Node { }
@@ -201,3 +202,10 @@ private predicate lib2xmlOptionLocalTaintStep(DataFlow::Node source, DataFlow::N
201202
source.asExpr() = int32Init.getAnArgument().getExpr() and sink.asExpr() = int32Init
202203
)
203204
}
205+
206+
/**
207+
* A sink defined in a CSV model.
208+
*/
209+
private class DefaultXxeSink extends XxeSink {
210+
DefaultXxeSink() { sinkNode(this, "xxe") }
211+
}

0 commit comments

Comments
 (0)