Skip to content

Commit ce74c9d

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: Date models as neutral
1 parent 6bb865a commit ce74c9d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

java/ql/lib/ext/java.text.model.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ extensions:
33
pack: codeql/java-all
44
extensible: neutralModel
55
data:
6-
- ["java.text", "DateFormat", "format", "(Date)", "manual"]
7-
- ["java.text", "SimpleDateFormat", "SimpleDateFormat", "(String)", "manual"]
6+
# The below APIs have numeric flow and are currently being stored as neutral models.
7+
# These may be changed to summary models with kinds "value-numeric" and "taint-numeric" (or similar) in the future.
8+
- ["java.text", "DateFormat", "format", "(Date)", "manual"] # taint-numeric
9+
- ["java.text", "SimpleDateFormat", "SimpleDateFormat", "(String)", "manual"] # taint-numeric

java/ql/lib/ext/java.time.model.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ extensions:
44
extensible: neutralModel
55
data:
66
- ["java.time", "Instant", "now", "()", "manual"]
7-
- ["java.time", "LocalDate", "of", "(int,int,int)", "manual"]
87
- ["java.time", "ZonedDateTime", "now", "()", "manual"]
8+
9+
# The below APIs have numeric flow and are currently being stored as neutral models.
10+
# These may be changed to summary models with kinds "value-numeric" and "taint-numeric" (or similar) in the future.
11+
- ["java.time", "LocalDate", "of", "(int,int,int)", "manual"] # taint-numeric

java/ql/src/Telemetry/ExternalApi.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class ExternalApi extends Callable {
4747
* Gets information about the external API in the form expected by the CSV modeling framework.
4848
*/
4949
string getApiName() {
50-
this.getName() = "append" and
5150
result =
5251
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().getSourceDeclaration() +
5352
"#" + this.getName() + paramsString(this)

0 commit comments

Comments
 (0)