Skip to content

Commit

Permalink
Merge pull request apache#12 from BulkSecurityGeneratorProjectV2/fix/…
Browse files Browse the repository at this point in the history
…JLL/zip-slip-vulnerability

[SECURITY] Fix Zip Slip Vulnerability
  • Loading branch information
fpapon authored Nov 6, 2022
2 parents f292b0b + f327df8 commit 83fa43f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/cli/src/main/java/org/apache/batchee/cli/zip/Zips.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public static void unzip(final File zipFile, final File destination) throws IOEx
while ((entry = in.getNextEntry()) != null) {
final String path = entry.getName();
final File file = new File(destination, path);
if (!file.toPath().normalize().startsWith(destination.toPath().normalize())) {
throw new IOException("Bad zip entry");
}

if (entry.isDirectory()) {
continue;
Expand Down

0 comments on commit 83fa43f

Please sign in to comment.