Skip to content

Commit f160c6c

Browse files
authored
Merge pull request #14195 from Kwstubbs/SQL_int_sanitizer
Add Integer/Boolean Sanitizer to SQL injection Query
2 parents 062024b + aaa230a commit f160c6c

File tree

4 files changed

+131
-107
lines changed

4 files changed

+131
-107
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Added Numeric and Boolean types to SQL injection sanitzers.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,13 @@ module SqlInjection {
4040

4141
/** A NoSql query, considered as a taint sink for SQL injection. */
4242
class NoSqlQueryAsSink extends Sink instanceof NoSql::Query { }
43+
44+
/**
45+
* A numeric- or boolean-typed node, considered a sanitizer for sql injection.
46+
*/
47+
class NumericOrBooleanSanitizer extends Sanitizer {
48+
NumericOrBooleanSanitizer() {
49+
this.getType() instanceof NumericType or this.getType() instanceof BoolType
50+
}
51+
}
4352
}

0 commit comments

Comments
 (0)