diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/util/JarScanner.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/util/JarScanner.java index 6f5793914..85e957a3a 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/util/JarScanner.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/util/JarScanner.java @@ -52,6 +52,10 @@ public void scan() { while (jarFileEntries.hasMoreElements()) { JarEntry entry = jarFileEntries.nextElement(); String name = entry.getName(); + if (name.startsWith("..") || name.startsWith("/")) { + // ignore "zip slip" file pattern attack + continue; + } char[][] tokenizedName = tokenizePathToCharArray(name, File.separator); if (name.endsWith("/")) { // entry is a directory -> skip