File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
go/ql/lib/semmle/go/security Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Classes to represent sanitizers commonly used in dataflow and taint tracking
3+ * configurations.
4+ */
5+
6+ import go
7+
8+ /**
9+ * A node whose type is a simple type unlikely to carry taint, such as a
10+ * numeric or boolean type.
11+ */
12+ class SimpleTypeSanitizer extends DataFlow:: Node {
13+ SimpleTypeSanitizer ( ) {
14+ this .getType ( ) instanceof NumericType or this .getType ( ) instanceof BoolType
15+ }
16+ }
Original file line number Diff line number Diff line change 44 */
55
66import go
7+ private import semmle.go.security.Sanitizers
78
89/**
910 * Provides extension points for customizing the taint tracking configuration for reasoning about
@@ -39,12 +40,11 @@ module SqlInjection {
3940 /** A NoSql query, considered as a taint sink for SQL injection. */
4041 class NoSqlQueryAsSink extends Sink instanceof NoSql:: Query { }
4142
43+ /** DEPRECATED: Use `SimpleTypeSanitizer` from semmle.go.security.Sanitizers instead. */
44+ deprecated class NumericOrBooleanSanitizer = SimpleTypeSanitizer ;
45+
4246 /**
4347 * A numeric- or boolean-typed node, considered a sanitizer for sql injection.
4448 */
45- class NumericOrBooleanSanitizer extends Sanitizer {
46- NumericOrBooleanSanitizer ( ) {
47- this .getType ( ) instanceof NumericType or this .getType ( ) instanceof BoolType
48- }
49- }
49+ private class DefaultSanitizer extends Sanitizer instanceof SimpleTypeSanitizer { }
5050}
You can’t perform that action at this time.
0 commit comments