Skip to content

Commit

Permalink
Merge pull request #17579 from aschackmull/java/type-sanitizers
Browse files Browse the repository at this point in the history
Java: Add more type-based sanitizers.
  • Loading branch information
aschackmull authored Sep 30, 2024
2 parents 8a1b450 + aaecb9b commit a017f92
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion java/ql/lib/semmle/code/java/security/Sanitizers.qll
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ class SimpleTypeSanitizer extends DataFlow::Node {
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")
this.getType().(RefType).getASourceSupertype*().hasQualifiedName("java.util", "Date") or
this.getType().(RefType).hasQualifiedName("java.util", "Calendar") or
this.getType().(RefType).hasQualifiedName("java.util", "BitSet") or
this.getType()
.(RefType)
.getASourceSupertype*()
.hasQualifiedName("java.time.temporal", "TemporalAmount") or
this.getType()
.(RefType)
.getASourceSupertype*()
.hasQualifiedName("java.time.temporal", "TemporalAccessor")
}
}

0 comments on commit a017f92

Please sign in to comment.