Skip to content

Commit 0585c2f

Browse files
committed
PS: Gets back the previously-lost false negative by making the variable property name expression the sink when there is a call to 'Invoke'.
1 parent f882af9 commit 0585c2f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

powershell/ql/lib/semmle/code/powershell/security/CommandInjectionCustomizations.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ module CommandInjection {
142142
class InvokeSink extends Sink {
143143
InvokeSink() {
144144
exists(InvokeMemberExpr ie |
145-
this.asExpr().getExpr() = ie.getCallee() or
146-
this.asExpr().getExpr() = ie.getQualifier()
147-
)
145+
this.asExpr().getExpr() = ie.getCallee()
146+
or
147+
ie.getAName() = "Invoke" and
148+
ie.getQualifier().(MemberExprReadAccess).getMemberExpr() = this.asExpr().getExpr()
149+
)
148150
}
149151

150152
override string getSinkType() { result = "call to Invoke" }

0 commit comments

Comments
 (0)