Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 046d4a0

Browse files
committed
Java: Add taint step for String::concat.
1 parent a42d9b1 commit 046d4a0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

java/ql/src/semmle/code/java/dataflow/TaintTracking.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ module TaintTracking {
377377
private predicate taintPreservingQualifierToMethod(Method m) {
378378
m.getDeclaringType() instanceof TypeString and
379379
(
380+
m.getName() = "concat" or
380381
m.getName() = "endsWith" or
381382
m.getName() = "getBytes" or
382383
m.getName() = "split" or
@@ -481,6 +482,10 @@ module TaintTracking {
481482
method.getName().matches("to%String") and arg = 0
482483
)
483484
or
485+
method.getDeclaringType() instanceof TypeString and
486+
method.getName() = "concat" and
487+
arg = 0
488+
or
484489
(
485490
method.getDeclaringType().hasQualifiedName("java.lang", "StringBuilder") or
486491
method.getDeclaringType().hasQualifiedName("java.lang", "StringBuffer")

0 commit comments

Comments
 (0)