Skip to content

Commit f8428f8

Browse files
committed
[SECURITY-3583] Fix CSRF vulnerability in Groovy script choice parameter
Testing done * Confirmed that I could see the failure documented in the security issue without this change (both methods) * Confirmed that the failure documented in the security issue is no longer visible with this change. Checked both methods * Reviewed all the POST security scanning alerts in the GitHub repository, resolved those that were not an issue, and included a fix in this pull request for those that I thought were more risky
1 parent c3771c5 commit f8428f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/jp/ikedam/jenkins/plugins/extensible_choice_parameter/SystemGroovyChoiceListProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.kohsuke.stapler.QueryParameter;
5353
import org.kohsuke.stapler.Stapler;
5454
import org.kohsuke.stapler.StaplerRequest2;
55+
import org.kohsuke.stapler.verb.POST;
5556

5657
/**
5758
* A choice provider whose choices are determined by a Groovy script.
@@ -115,6 +116,7 @@ public String getDisplayName() {
115116
* @param usePredefinedVariables
116117
* @return the selection of a default choice
117118
*/
119+
@POST
118120
public ListBoxModel doFillDefaultChoiceItems(
119121
@AncestorInPath Job<?, ?> job,
120122
@RelativePath("groovyScript") @QueryParameter String script,
@@ -166,6 +168,7 @@ public String getNoDefaultChoice() {
166168
return NoDefaultChoice;
167169
}
168170

171+
@POST
169172
public FormValidation doTest(
170173
@AncestorInPath Job<?, ?> job,
171174
// Define same as `doFillDefaultChoiceItems`

0 commit comments

Comments
 (0)