mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 14:32:22 +00:00
[FIXED SECURITY-155] Do not allow plugin code to be downloaded via doDynamic, only static resources.
This commit is contained in:
1 parent
31e5d10be0
commit
f0a29b562e
2 files changed
+8
No files matched your search
@@ -42,6 +42,7 @@ import net.sf.json.JSONObject;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import org.kohsuke.stapler.HttpResponses;
|
||||
|
||||
/**
|
||||
* Base class of Hudson plugin.
|
||||
@@ -200,6 +201,10 @@ public abstract class Plugin implements Saveable {
|
||||
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
|
||||
String path = req.getRestOfPath();
|
||||
|
||||
if (path.startsWith("/META-INF/") || path.startsWith("/WEB-INF/")) {
|
||||
throw HttpResponses.notFound();
|
||||
}
|
||||
|
||||
if(path.length()==0)
|
||||
path = "/";
|
||||
|
||||
|
||||
Reference in new issue
Block a user