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

Skip to content

Commit 7c4251d

Browse files
committed
Java: Add flow out of Map and List
1 parent 6de2b93 commit 7c4251d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,17 @@ private predicate taintPreservingQualifierToMethod(Method m) {
358358
m = any(GuiceProvider gp).getAnOverridingGetMethod()
359359
or
360360
m = any(ProtobufMessageLite p).getAGetterMethod()
361+
or
362+
m instanceof MapMethod and
363+
(
364+
m.getName().regexpMatch("get|entrySet|keySet|values")
365+
)
366+
or
367+
m.getDeclaringType().getSourceDeclaration().getASourceSupertype*().hasQualifiedName("java.util", "List") and
368+
(
369+
m.getName().regexpMatch("get|toArray|subList|spliterator|set|iterator|listIterator") or
370+
(m.getName().regexpMatch("remove") and not m.getReturnType() instanceof BooleanType)
371+
)
361372
}
362373

363374
private class StringReplaceMethod extends Method {

0 commit comments

Comments
 (0)