Swift: Simplify allowImplicitRead slightly.

This commit is contained in:
Geoffrey White
2023-10-05 16:26:30 +01:00
parent 7ddece1560
commit fdcc6b482d

View File

@@ -40,16 +40,13 @@ module CleartextStorageDatabaseConfig implements DataFlow::ConfigSig {
c.getAReadContent().(DataFlow::Content::FieldContent).getField() = cx.getAMember()
)
or
// flow out from dictionary values at the sink (this is essential for some of the
// SQLite.swift models)
// flow out from dictionary tuple values at the sink (this is essential
// for some of the SQLite.swift models).
isSink(node) and
node.asExpr().getType().getUnderlyingType() instanceof DictionaryType and
(
c.getAReadContent() instanceof DataFlow::Content::CollectionContent or
c.getAReadContent().(DataFlow::Content::TupleContent).getIndex() = 1
)
c.getAReadContent().(DataFlow::Content::TupleContent).getIndex() = 1
or
// flow out from array elements of at the sink,
// flow out from array elements (and other collection content) at the sink,
// for example in `database.allStatements(sql: "", arguments: [sensitive])`.
isSink(node) and
c.getAReadContent() instanceof DataFlow::Content::CollectionContent