Java: Track taint through java.io.File::toPath & java.nio.file.Path::toFile

This commit is contained in:
Jonathan Leitschuh
2020-10-13 21:15:09 -04:00
parent b49aa677d0
commit fc71ca747d
3 changed files with 15 additions and 1 deletions

View File

@@ -377,7 +377,13 @@ private predicate taintPreservingQualifierToMethod(Method m) {
m.getDeclaringType().hasQualifiedName("java.nio", "ByteBuffer") and
m.hasName("get")
or
m.getDeclaringType().hasQualifiedName("java.io", "File") and
m.getDeclaringType() instanceof TypeFile and
m.hasName("toPath")
or
m.getDeclaringType() instanceof TypePath and
m.hasName("toFile")
or
m.getDeclaringType() instanceof TypeFile and
m.hasName("toURI")
or
m.getDeclaringType().hasQualifiedName("java.net", "URI") and