diff --git a/powershell/ql/lib/semmle/code/powershell/security/CommandInjectionCustomizations.qll b/powershell/ql/lib/semmle/code/powershell/security/CommandInjectionCustomizations.qll index 4ff098f1e19..2309490cb2a 100644 --- a/powershell/ql/lib/semmle/code/powershell/security/CommandInjectionCustomizations.qll +++ b/powershell/ql/lib/semmle/code/powershell/security/CommandInjectionCustomizations.qll @@ -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" }