@@ -44,10 +44,7 @@ class MethodFileCreateTempFile extends Method {
4444}
4545
4646/**
47- * Find dataflow from the temp directory system property to the `File` constructor.
48- * Examples:
49- * - `new File(System.getProperty("java.io.tmpdir"))`
50- * - `new File(new File(System.getProperty("java.io.tmpdir")), "/child")`
47+ * Holds if `expDest` is some constructor call `new java.io.File(x)` and `expSource` is `x`.
5148 */
5249private predicate isFileConstructorArgument ( Expr expSource , Expr exprDest ) {
5350 exists ( ConstructorCall construtorCall |
@@ -69,7 +66,7 @@ private class TaintFollowingFileMethod extends Method {
6966
7067private predicate isTaintPropagatingFileTransformation ( Expr expSource , Expr exprDest ) {
7168 exists ( MethodAccess fileMethodAccess |
72- fileMethodAccess .getMethod ( ) instanceof TaintPropagatingFileMethod and
69+ fileMethodAccess .getMethod ( ) instanceof TaintFollowingFileMethod and
7370 fileMethodAccess .getQualifier ( ) = expSource and
7471 fileMethodAccess = exprDest
7572 )
@@ -80,6 +77,6 @@ private predicate isTaintPropagatingFileTransformation(Expr expSource, Expr expr
8077 * For example, `taintedFile.getCanonicalFile()` is itself tainted.
8178 */
8279predicate isAdditionalFileTaintStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
83- isTaintedFileCreation ( node1 .asExpr ( ) , node2 .asExpr ( ) ) or
84- isTaintFollowingFileTransformation ( node1 .asExpr ( ) , node2 .asExpr ( ) )
80+ isFileConstructorArgument ( node1 .asExpr ( ) , node2 .asExpr ( ) ) or
81+ isTaintPropagatingFileTransformation ( node1 .asExpr ( ) , node2 .asExpr ( ) )
8582}
0 commit comments