Skip to content

Commit 091ee0d

Browse files
olivergondzadaniel-beck
authored andcommitted
[SECURITY-1101]
1 parent de016a5 commit 091ee0d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/main/java/hudson/tasks/junit/JUnitResultArchiver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import hudson.model.AbstractProject;
3333
import hudson.model.BuildListener;
3434
import hudson.model.Descriptor;
35+
import hudson.model.Item;
3536
import hudson.model.Result;
3637
import hudson.model.Run;
3738
import hudson.model.Saveable;
@@ -310,7 +311,7 @@ public String getDisplayName() {
310311
public FormValidation doCheckTestResults(
311312
@AncestorInPath AbstractProject project,
312313
@QueryParameter String value) throws IOException {
313-
if (project == null) {
314+
if (project == null || !project.hasPermission(Item.WORKSPACE)) {
314315
return FormValidation.ok();
315316
}
316317
return FilePath.validateFileMask(project.getSomeWorkspace(), value);

src/main/java/hudson/tasks/test/AggregatedTestResultPublisher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ public AggregatedTestResultPublisher newInstance(StaplerRequest req, JSONObject
377377
}
378378

379379
public AutoCompletionCandidates doAutoCompleteJobs(@QueryParameter String value, @AncestorInPath Item self, @AncestorInPath ItemGroup container) {
380+
// Item.READ checked inside
380381
return AutoCompletionCandidates.ofJobNames(Job.class,value,self,container);
381382
}
382383
}

src/main/java/hudson/tasks/test/TestObject.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.kohsuke.stapler.export.ExportedBean;
4141

4242
import com.google.common.collect.MapMaker;
43+
import org.kohsuke.stapler.interceptor.RequirePOST;
4344

4445
import javax.servlet.ServletException;
4546
import java.io.IOException;
@@ -450,13 +451,14 @@ public Object getDynamic(String token, StaplerRequest req,
450451
return null;
451452
}
452453

454+
@RequirePOST
453455
public synchronized HttpResponse doSubmitDescription(
454456
@QueryParameter String description) throws IOException,
455457
ServletException {
458+
getRun().checkPermission(Run.UPDATE);
456459
if (getRun() == null) {
457460
LOGGER.severe("getRun() is null, can't save description.");
458461
} else {
459-
getRun().checkPermission(Run.UPDATE);
460462
setDescription(description);
461463
getRun().save();
462464
}

0 commit comments

Comments
 (0)