Improve ZipSlip exclusion to take varargs into account

This commit is contained in:
Tony Torralba
2023-06-07 09:25:42 +02:00
parent 8001ae9669
commit 27763d6bbe

View File

@@ -54,7 +54,10 @@ private class FileCreationSink extends DataFlow::Node {
*/
private predicate isPathCreation(DataFlow::Node sink) {
exists(PathCreation pc |
pc.getAnInput() = sink.asExpr() and
pc.getAnInput() = sink.asExpr()
or
pc.getAnInput().(Argument).isVararg() and sink.(DataFlow::ImplicitVarargsArray).getCall() = pc
|
// exclude actual read/write operations included in `PathCreation`
not pc.(Call)
.getCallee()