Skip to content

Commit 4602f89

Browse files
authored
Merge pull request #15292 from egregius313/egregius313/java/dataflow/common-sanitizers/uuid-and-date
Java: Add `java.util.UUID` and `java.util.Date` to the `SimpleTypeSanitizer` class
2 parents 031bd8b + ef884fa commit 4602f89

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Added the `java.util.Date` and `java.util.UUID` classes to the list of types in the `SimpleTypeSanitizer` class in `semmle.code.java.security.Sanitizers`.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import java
44
private import semmle.code.java.dataflow.DataFlow
55

66
/**
7-
* A node whose type is a simple type unlikely to carry taint, such as primitives or their boxed counterparts.
7+
* A node whose type is a simple type unlikely to carry taint, such as primitives and their boxed counterparts,
8+
* `java.util.UUID` and `java.util.Date`.
89
*/
910
class SimpleTypeSanitizer extends DataFlow::Node {
1011
SimpleTypeSanitizer() {
1112
this.getType() instanceof PrimitiveType or
1213
this.getType() instanceof BoxedType or
13-
this.getType() instanceof NumberType
14+
this.getType() instanceof NumberType or
15+
this.getType().(RefType).hasQualifiedName("java.util", "UUID") or
16+
this.getType().(RefType).hasQualifiedName("java.util", "Date")
1417
}
1518
}

0 commit comments

Comments
 (0)