mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Swift: Use a barrier as a simple fix.
This commit is contained in:
@@ -64,5 +64,12 @@ private class CommandInjectionDefaultBarrier extends CommandInjectionBarrier {
|
||||
CommandInjectionDefaultBarrier() {
|
||||
// any numeric type
|
||||
this.asExpr().getType().getUnderlyingType().getABaseType*().getName() = "Numeric"
|
||||
or
|
||||
// we get poor results when the tainted data is a directory list, such as
|
||||
// the result of `FileMananger.contentsOfDirectory` and similar functions.
|
||||
exists(CallExpr ce |
|
||||
ce.getStaticTarget().getName().matches(["%directory%", "%Directory%"]) and
|
||||
this.asExpr() = ce
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user