PS: Gets back the previously-lost false negative by making the variable property name expression the sink when there is a call to 'Invoke'.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-07-04 11:12:31 +01:00
parent f882af95d8
commit 0585c2f9e5

View File

@@ -142,9 +142,11 @@ module CommandInjection {
class InvokeSink extends Sink {
InvokeSink() {
exists(InvokeMemberExpr ie |
this.asExpr().getExpr() = ie.getCallee() or
this.asExpr().getExpr() = ie.getQualifier()
)
this.asExpr().getExpr() = ie.getCallee()
or
ie.getAName() = "Invoke" and
ie.getQualifier().(MemberExprReadAccess).getMemberExpr() = this.asExpr().getExpr()
)
}
override string getSinkType() { result = "call to Invoke" }