mirror of
https://github.com/github/codeql.git
synced 2026-02-20 17:03:41 +01:00
19 lines
680 B
Plaintext
19 lines
680 B
Plaintext
/** Classes to represent sanitizers commonly used in dataflow and taint tracking configurations. */
|
|
|
|
import java
|
|
private import semmle.code.java.dataflow.DataFlow
|
|
|
|
/**
|
|
* A node whose type is a simple type unlikely to carry taint, such as primitives and their boxed counterparts,
|
|
* `java.util.UUID` and `java.util.Date`.
|
|
*/
|
|
class SimpleTypeSanitizer extends DataFlow::Node {
|
|
SimpleTypeSanitizer() {
|
|
this.getType() instanceof PrimitiveType or
|
|
this.getType() instanceof BoxedType or
|
|
this.getType() instanceof NumberType or
|
|
this.getType().(RefType).hasQualifiedName("java.util", "UUID") or
|
|
this.getType().(RefType).hasQualifiedName("java.util", "Date")
|
|
}
|
|
}
|