Skip to content

Commit 7f9930e

Browse files
committed
PS: Add a barrier to block flow on validated parameters.
1 parent b85c176 commit 7f9930e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,15 @@ module SqlInjection {
106106
}
107107

108108
class TypeSanitizer extends Sanitizer instanceof SimpleTypeSanitizer { }
109+
110+
class ValidateAttributeSanitizer extends Sanitizer {
111+
ValidateAttributeSanitizer() {
112+
exists(Function f, Attribute a, Parameter p |
113+
p = f.getAParameter() and
114+
p.getAnAttribute() = a and
115+
a.getAName() = ["ValidateScript", "ValidateSet", "ValidatePattern"] and
116+
this.asParameter() = p
117+
)
118+
}
119+
}
109120
}

0 commit comments

Comments
 (0)