Merge pull request #19260 from smowton/smowton/feature/sanitize-enum-types

Java: Add EnumType to SimpleTypeSanitizer
This commit is contained in:
Chris Smowton
2025-04-09 16:05:13 +01:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Enum-typed values are now assumed to be safe by most queries. This means that queries may return fewer results where an enum value is used in a sensitive context, e.g. pasted into a query string.

View File

@@ -23,6 +23,7 @@ class SimpleTypeSanitizer extends DataFlow::Node {
this.getType()
.(RefType)
.getASourceSupertype*()
.hasQualifiedName("java.time.temporal", "TemporalAccessor")
.hasQualifiedName("java.time.temporal", "TemporalAccessor") or
this.getType() instanceof EnumType
}
}