Add the SimpleScalarSanitizer class

The `SimpleScalarSanitizer` class represents common scalar types which
cannot realistically carry taint (e.g. primitives/numbers, and
eventually UUIDs and Dates)
This commit is contained in:
Ed Minnix
2024-01-09 12:07:30 -05:00
parent 24b37ffd36
commit 7f7c49d6ce

View File

@@ -0,0 +1,15 @@
/** Classes to represent sanitizers commonly used in dataflow and taint tracking configurations. */
import java
import semmle.code.java.dataflow.DataFlow
/**
* A node whose type is a common scalar type, such as primitives or their boxed counterparts.
*/
class SimpleScalarSanitizer extends DataFlow::Node {
SimpleScalarSanitizer() {
this.getType() instanceof PrimitiveType or
this.getType() instanceof BoxedType or
this.getType() instanceof NumberType
}
}