Skip to content

Commit 1838a74

Browse files
committed
Java: Add taint steps for String.formatted.
1 parent 8ce9c9d commit 1838a74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/ql/src/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ private predicate taintPreservingQualifierToMethod(Method m) {
296296
(
297297
m.getName() = "concat" or
298298
m.getName() = "endsWith" or
299+
m.getName() = "formatted" or
299300
m.getName() = "getBytes" or
300301
m.getName() = "split" or
301302
m.getName() = "substring" or
@@ -395,7 +396,7 @@ private predicate argToMethodStep(Expr tracked, MethodAccess sink) {
395396
*/
396397
private predicate taintPreservingArgumentToMethod(Method method) {
397398
method.getDeclaringType() instanceof TypeString and
398-
(method.hasName("format") or method.hasName("join"))
399+
(method.hasName("format") or method.hasName("formatted") or method.hasName("join"))
399400
}
400401

401402
/**

0 commit comments

Comments
 (0)