Skip to content

Commit 32487df

Browse files
authored
Merge pull request orphan-oss#183 from BulkSecurityGeneratorProjectV2/fix/JLL/zip-slip-vulnerability
[SECURITY] Fix Zip Slip Vulnerability
2 parents 798b1e1 + 149c0aa commit 32487df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,9 @@ private File unpackWorkDir(Artifact artifact) throws MojoExecutionException {
525525
while (en.hasMoreElements()) {
526526
JarEntry je = en.nextElement();
527527
File outFile = new File(dest, je.getName());
528+
if (!outFile.toPath().normalize().startsWith(dest.toPath().normalize())) {
529+
throw new RuntimeException("Bad zip entry");
530+
}
528531
File parent = outFile.getParentFile();
529532
if (parent != null) parent.mkdirs();
530533
if (je.isDirectory()) {

0 commit comments

Comments
 (0)