Skip to content

Commit 27763d6

Browse files
committed
Improve ZipSlip exclusion to take varargs into account
1 parent 8001ae9 commit 27763d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

java/ql/lib/semmle/code/java/security/ZipSlipQuery.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ private class FileCreationSink extends DataFlow::Node {
5454
*/
5555
private predicate isPathCreation(DataFlow::Node sink) {
5656
exists(PathCreation pc |
57-
pc.getAnInput() = sink.asExpr() and
57+
pc.getAnInput() = sink.asExpr()
58+
or
59+
pc.getAnInput().(Argument).isVararg() and sink.(DataFlow::ImplicitVarargsArray).getCall() = pc
60+
|
5861
// exclude actual read/write operations included in `PathCreation`
5962
not pc.(Call)
6063
.getCallee()

0 commit comments

Comments
 (0)