File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
powershell/ql/lib/semmle/code/powershell/security Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,19 @@ module SqlInjection {
4848 override string getSourceType ( ) { result = this .( SourceNode ) .getSourceType ( ) }
4949 }
5050
51+ private string query ( ) { result = [ "query" , "q" ] }
52+
53+ private string inputfile ( ) { result = [ "inputfile" , "i" ] }
54+
5155 class InvokeSqlCmdSink extends Sink {
5256 InvokeSqlCmdSink ( ) {
5357 exists ( DataFlow:: CallNode call | call .matchesName ( "Invoke-Sqlcmd" ) |
54- this = call .getNamedArgument ( " query" )
58+ this = call .getNamedArgument ( query ( ) )
5559 or
56- this = call .getNamedArgument ( " inputfile" )
60+ this = call .getNamedArgument ( inputfile ( ) )
5761 or
58- not call .hasNamedArgument ( " query" ) and
59- not call .hasNamedArgument ( " inputfile" ) and
62+ not call .hasNamedArgument ( query ( ) ) and
63+ not call .hasNamedArgument ( inputfile ( ) ) and
6064 this = call .getArgument ( 0 )
6165 or
6266 // TODO: Here we really should pick a splat argument, but we don't yet extract whether an
You can’t perform that action at this time.
0 commit comments