mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
Java: Add java.lang.Number as a sanitizer for SQL injection.
This commit is contained in:
@@ -54,7 +54,9 @@ private class QueryInjectionFlowConfig extends TaintTracking::Configuration {
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof QueryInjectionSink }
|
||||
|
||||
override predicate isSanitizer(DataFlow::Node node) {
|
||||
node.getType() instanceof PrimitiveType or node.getType() instanceof BoxedType
|
||||
node.getType() instanceof PrimitiveType or
|
||||
node.getType() instanceof BoxedType or
|
||||
node.getType() instanceof NumberType
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,16 @@ class TypeMath extends Class {
|
||||
TypeMath() { this.hasQualifiedName("java.lang", "Math") }
|
||||
}
|
||||
|
||||
/** The class `java.lang.Number`. */
|
||||
class TypeNumber extends RefType {
|
||||
TypeNumber() { this.hasQualifiedName("java.lang", "Number") }
|
||||
}
|
||||
|
||||
/** A (reflexive, transitive) subtype of `java.lang.Number`. */
|
||||
class NumberType extends RefType {
|
||||
NumberType() { exists(TypeNumber number | hasSubtype*(number, this)) }
|
||||
}
|
||||
|
||||
/** A numeric type, including both primitive and boxed types. */
|
||||
class NumericType extends Type {
|
||||
NumericType() {
|
||||
|
||||
Reference in New Issue
Block a user