Skip to content

Commit 7d213d5

Browse files
committed
Add Integer/Boolean Sanitizer
1 parent ecf1d98 commit 7d213d5

File tree

3 files changed

+127
-107
lines changed

3 files changed

+127
-107
lines changed

go/ql/lib/semmle/go/security/SqlInjectionCustomizations.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ module SqlInjection {
2525
*/
2626
abstract class Sanitizer extends DataFlow::Node { }
2727

28+
/**
29+
* A numeric- or boolean-typed node, considered a sanitizer for sql injection.
30+
*/
31+
class NumericOrBooleanSanitizer extends Sanitizer {
32+
NumericOrBooleanSanitizer() {
33+
this.getType() instanceof NumericType or this.getType() instanceof BoolType
34+
}
35+
}
36+
2837
/**
2938
* DEPRECATED: Use `Sanitizer` instead.
3039
*

0 commit comments

Comments
 (0)