Fix path problem in NpmPackage

This commit is contained in:
Grahame Grieve 2023-07-27 17:50:08 +10:00
parent 4eff9a3b68
commit 774440d0a7
1 changed files with 1 additions and 1 deletions

View File

@ -462,7 +462,7 @@ public class NpmPackage {
while ((entry = (TarArchiveEntry) tarIn.getNextEntry()) != null) {
String n = entry.getName();
if (n.contains("..")) {
if (n.contains("/..") || n.contains("../")) {
throw new RuntimeException("Entry with an illegal name: " + n);
}
if (entry.isDirectory()) {