diff --git a/java/ql/lib/change-notes/2023-08-21-java-command-injection-sanitizer.md b/java/ql/lib/change-notes/2023-08-21-java-command-injection-sanitizer.md new file mode 100644 index 00000000000..ca183d5d065 --- /dev/null +++ b/java/ql/lib/change-notes/2023-08-21-java-command-injection-sanitizer.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added new sanitizer to Java command injection model \ No newline at end of file diff --git a/java/ql/lib/semmle/code/java/security/CommandLineQuery.qll b/java/ql/lib/semmle/code/java/security/CommandLineQuery.qll index c0d09a9eeab..30772d9fdf1 100644 --- a/java/ql/lib/semmle/code/java/security/CommandLineQuery.qll +++ b/java/ql/lib/semmle/code/java/security/CommandLineQuery.qll @@ -42,6 +42,8 @@ private class DefaultCommandInjectionSanitizer extends CommandInjectionSanitizer or this.getType() instanceof BoxedType or + this.getType() instanceof NumberType + or isSafeCommandArgument(this.asExpr()) } }