Skip to content

Commit 95926cb

Browse files
committed
PS: Remove environment variables as flow sources from 'powershell/microsoft/public/sql-injection'.
1 parent 7c83d9d commit 95926cb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ module SqlInjection {
3838
abstract class Sanitizer extends DataFlow::Node { }
3939

4040
/** A source of user input, considered as a flow source for command injection. */
41-
class FlowSourceAsSource extends Source instanceof SourceNode {
42-
override string getSourceType() { result = SourceNode.super.getSourceType() }
41+
class FlowSourceAsSource extends Source {
42+
FlowSourceAsSource() {
43+
this instanceof SourceNode and
44+
not this instanceof EnvironmentVariableSource
45+
}
46+
47+
override string getSourceType() { result = this.(SourceNode).getSourceType() }
4348
}
4449

4550
class InvokeSqlCmdSink extends Sink {

0 commit comments

Comments
 (0)