mirror of
https://github.com/github/codeql.git
synced 2026-04-18 21:44:02 +02:00
Swift: Add consistent CSV extension points.
This commit is contained in:
@@ -25,6 +25,9 @@ class CleartextLoggingAdditionalTaintStep extends Unit {
|
||||
abstract predicate step(DataFlow::Node n1, DataFlow::Node n2);
|
||||
}
|
||||
|
||||
/**
|
||||
* A sink defined in a CSV model.
|
||||
*/
|
||||
private class DefaultCleartextLoggingSink extends CleartextLoggingSink {
|
||||
DefaultCleartextLoggingSink() { sinkNode(this, "logging") }
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ class PathInjectionAdditionalTaintStep extends Unit {
|
||||
abstract predicate step(DataFlow::Node node1, DataFlow::Node node2);
|
||||
}
|
||||
|
||||
/**
|
||||
* A sink defined in a CSV model.
|
||||
*/
|
||||
private class DefaultPathInjectionSink extends PathInjectionSink {
|
||||
DefaultPathInjectionSink() { sinkNode(this, "path-injection") }
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ class PredicateInjectionAdditionalTaintStep extends Unit {
|
||||
abstract predicate step(DataFlow::Node n1, DataFlow::Node n2);
|
||||
}
|
||||
|
||||
/**
|
||||
* A sink defined in a CSV model.
|
||||
*/
|
||||
private class DefaultPredicateInjectionSink extends PredicateInjectionSink {
|
||||
DefaultPredicateInjectionSink() { sinkNode(this, "predicate-injection") }
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ private class DefaultUncontrolledFormatStringSink extends UncontrolledFormatStri
|
||||
// the format argument to a `FormattingFunctionCall`.
|
||||
this.asExpr() = any(FormattingFunctionCall fc).getFormat()
|
||||
or
|
||||
// a sink defined in a Csv model.
|
||||
// a sink defined in a CSV model.
|
||||
sinkNode(this, "uncontrolled-format-string")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import swift
|
||||
private import codeql.swift.dataflow.DataFlow
|
||||
private import codeql.swift.frameworks.AEXML
|
||||
private import codeql.swift.frameworks.Libxml2
|
||||
private import codeql.swift.dataflow.ExternalFlow
|
||||
|
||||
/** A data flow sink for XML external entities (XXE) vulnerabilities. */
|
||||
abstract class XxeSink extends DataFlow::Node { }
|
||||
@@ -201,3 +202,10 @@ private predicate lib2xmlOptionLocalTaintStep(DataFlow::Node source, DataFlow::N
|
||||
source.asExpr() = int32Init.getAnArgument().getExpr() and sink.asExpr() = int32Init
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* A sink defined in a CSV model.
|
||||
*/
|
||||
private class DefaultXxeSink extends XxeSink {
|
||||
DefaultXxeSink() { sinkNode(this, "xxe") }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user