Skip to content

Commit

Permalink
Merge branch 'fix/JLL/zip-slip-vulnerability' of github.com:BulkSecur…
Browse files Browse the repository at this point in the history
…ityGeneratorProjectV2/VIDA-NYU__ache into BulkSecurityGeneratorProjectV2-fix/JLL/zip-slip-vulnerability
  • Loading branch information
aecio committed Feb 24, 2023
2 parents bed80dd + 2ce3b4a commit 8ed162d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ache/src/main/java/achecrawler/crawler/CrawlersManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ private void unzipFile(Path file, Path outputDir) throws IOException {
continue;
}
File entryDestination = new File(outputDir.toFile(), entry.getName());
if (!entryDestination.toPath().normalize().startsWith(outputDir.toFile().toPath().normalize())) {
// Prevent from zip slip vulnerability.
// See:https://github.com/VIDA-NYU/ache/pull/307
throw new IOException("Bad zip entry");
}
if (entry.isDirectory()) {
entryDestination.mkdirs();
} else {
Expand Down

0 comments on commit 8ed162d

Please sign in to comment.