Skip to content

Commit 5975546

Browse files
committed
Swift: Add numeric barrier for predicate injection query as well.
1 parent 2983295 commit 5975546

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ private class PredicateInjectionSinkCsv extends SinkModelCsv {
3939
]
4040
}
4141
}
42+
43+
/**
44+
* A barrier for predicate injection vulnerabilities vulnerabilities.
45+
*/
46+
private class PredicateInjectionDefaultBarrier extends PredicateInjectionBarrier {
47+
PredicateInjectionDefaultBarrier() {
48+
// any numeric type
49+
this.asExpr().getType().getUnderlyingType().getABaseType*().getName() = "Numeric"
50+
}
51+
}

0 commit comments

Comments
 (0)