Artifact/workspace browser was unable to serve directories/files that contains ".." in them.

(<a href="http://www.nabble.com/Status-Code-400-viewing-or-downloading-artifact-whose-filename-contains-two-consecutive-periods-tt21407604.html">report</a>)

This was due to a security check.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14408 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-01-13 00:45:05 +00:00
1 parent 9bd02f91fe
commit e1153d511c
3 files changed
+38 -3

No files matched your search

@@ -79,8 +79,8 @@ public final class DirectoryBrowserSupport {
return;
}
String path = getPath(req);
if(path.indexOf("..")!=-1) {
String path = getPath(req).replace('\\','/');
if(path.indexOf("/../")!=-1) {
// don't serve anything other than files in the artifacts dir
rsp.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;