From 930460424c715f52a7cb5eef5b084a7a8ef31fb5 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 5 Sep 2022 13:38:49 +1000 Subject: [PATCH] validate path Signed-off-by: Olivier Lamy --- .../archiva-web/archiva-webapp/pom.xml | 113 ------------------ .../ManagedDefaultRepositoryContent.java | 7 ++ 2 files changed, 7 insertions(+), 113 deletions(-) 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 -- 2.39.5