From: Olivier Lamy Date: Mon, 5 Sep 2022 03:38:49 +0000 (+1000) Subject: validate path X-Git-Tag: archiva-2.2.9~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=930460424c715f52a7cb5eef5b084a7a8ef31fb5;p=archiva.git validate path Signed-off-by: Olivier Lamy --- diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index 6e0c55e90..a6152f641 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -591,46 +591,6 @@ - - - - - - cglib cglib @@ -865,79 +825,6 @@ - org.apache.tomcat.maven tomcat7-maven-plugin diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java index aa4ca8a5a..3304d4868 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java @@ -91,6 +91,13 @@ public class ManagedDefaultRepositoryContent { throw new ContentNotFoundException( "cannot found project " + namespace + ":" + projectId ); } + try { + if (!directory.getCanonicalPath().equals(directory.getAbsolutePath())) { + throw new ContentNotFoundException( "Invalid directory for project " + namespace + ":" + projectId ); + } + } catch (IOException e) { + throw new RepositoryException(e.getMessage(), e); + } if ( directory.isDirectory() ) { try