mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-01 03:19:13 +00:00
464556 - Restrict start module downloads to ${jetty.base} paths only
+ Restrict [files] section references (download/uri/maven) to output only in ${jetty.base} tree
This commit is contained in:
parent
cea577bd17
commit
0e2b1856b5
@ -251,6 +251,11 @@ public class BaseBuilder
|
||||
{
|
||||
if (startArgs.isDownload() && (arg.uri != null))
|
||||
{
|
||||
if (!file.startsWith(baseHome.getBasePath()))
|
||||
{
|
||||
throw new IOException("For security reasons, Jetty start is unable to process file resource not in ${jetty.base} - " + file);
|
||||
}
|
||||
|
||||
URI uri = URI.create(arg.uri);
|
||||
|
||||
// Process via initializers
|
||||
|
@ -200,7 +200,7 @@ public class BaseHome
|
||||
*/
|
||||
public Path getBasePath(String path)
|
||||
{
|
||||
return baseDir.resolve(path);
|
||||
return baseDir.resolve(path).normalize().toAbsolutePath();
|
||||
}
|
||||
|
||||
public ConfigSources getConfigSources()
|
||||
|
@ -108,6 +108,11 @@ public class MavenLocalRepoFileInitializer extends UriFileInitializer implements
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!file.startsWith(baseHome.getBasePath()))
|
||||
{
|
||||
throw new IOException("For security reasons, Jetty start is unable to process maven file resource not in ${jetty.base} - " + file);
|
||||
}
|
||||
|
||||
// If using local repository
|
||||
if (this.localRepositoryDir != null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user