Skip to content

Commit f98de85

Browse files
committed
Swift: Add numeric barrier for command injection query.
1 parent 903b0f5 commit f98de85

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@ private class CommandInjectionSinks extends SinkModelCsv {
6969
]
7070
}
7171
}
72+
73+
/**
74+
* A barrier for command injection vulnerabilities.
75+
*/
76+
private class CommandInjectionDefaultBarrier extends CommandInjectionBarrier {
77+
CommandInjectionDefaultBarrier() {
78+
// any numeric type
79+
this.asExpr().getType().getUnderlyingType().getABaseType*().getName() = "Numeric"
80+
}
81+
}

0 commit comments

Comments
 (0)