Skip to content

Commit aaecb9b

Browse files
committed
Java: Add more type-based sanitizers.
1 parent 590e93d commit aaecb9b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

java/ql/lib/semmle/code/java/security/Sanitizers.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class SimpleTypeSanitizer extends DataFlow::Node {
1313
this.getType() instanceof BoxedType or
1414
this.getType() instanceof NumberType or
1515
this.getType().(RefType).hasQualifiedName("java.util", "UUID") or
16-
this.getType().(RefType).hasQualifiedName("java.util", "Date")
16+
this.getType().(RefType).getASourceSupertype*().hasQualifiedName("java.util", "Date") or
17+
this.getType().(RefType).hasQualifiedName("java.util", "Calendar") or
18+
this.getType().(RefType).hasQualifiedName("java.util", "BitSet") or
19+
this.getType()
20+
.(RefType)
21+
.getASourceSupertype*()
22+
.hasQualifiedName("java.time.temporal", "TemporalAmount") or
23+
this.getType()
24+
.(RefType)
25+
.getASourceSupertype*()
26+
.hasQualifiedName("java.time.temporal", "TemporalAccessor")
1727
}
1828
}

0 commit comments

Comments
 (0)