|
|
@ -173,6 +173,9 @@ public class UploadController { |
|
|
|
while (entries.hasMoreElements()) { |
|
|
|
while (entries.hasMoreElements()) { |
|
|
|
ZipEntry entry = (ZipEntry) entries.nextElement(); |
|
|
|
ZipEntry entry = (ZipEntry) entries.nextElement(); |
|
|
|
File entryFile = new File(file.getParentFile(), entry.getName()); |
|
|
|
File entryFile = new File(file.getParentFile(), entry.getName()); |
|
|
|
|
|
|
|
if (!entryFile.toPath().normalize().startsWith(file.getParentFile().toPath())) { |
|
|
|
|
|
|
|
throw new Exception("Bad zip filename: " + StringUtil.toHtml(entryFile.getPath())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!entry.isDirectory()) { |
|
|
|
if (!entry.isDirectory()) { |
|
|
|
|
|
|
|
|
|
|
@ -263,4 +266,4 @@ public class UploadController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|