Skip to content

Commit

Permalink
Merge pull request #103 from BulkSecurityGeneratorProjectV2/fix/JLL/z…
Browse files Browse the repository at this point in the history
…ip-slip-vulnerability

[SECURITY] Fix Zip Slip Vulnerability
  • Loading branch information
pgleeson committed Aug 1, 2022
2 parents a1c2c5a + 8c22463 commit 3e78551
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/lemsml/jlems/io/util/JUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ public static void unpackJar(File fjar, File fout) throws IOException {
while (en.hasMoreElements()) {
JarEntry je = en.nextElement();
java.io.File f = new File(fout, je.getName());
if (!f.toPath().normalize().startsWith(fout.toPath().normalize())) {
throw new RuntimeException("Bad zip entry");
}
if (je.isDirectory()) {
f.mkdirs();
continue;
Expand Down

0 comments on commit 3e78551

Please sign in to comment.