Skip to content

Commit

Permalink
[SECURITY-1094]
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadeck authored and daniel-beck committed Apr 30, 2020
1 parent 4e2870f commit 8954b3a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/java/hudson/scm/browsers/FishEyeCVS.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import jenkins.model.Jenkins;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.interceptor.RequirePOST;

import javax.servlet.ServletException;
import java.io.IOException;
Expand Down Expand Up @@ -84,6 +85,7 @@ public String getDisplayName() {
return "FishEye";
}

@RequirePOST
public FormValidation doCheckUrl(@QueryParameter String value) throws IOException, ServletException {
value = Util.fixEmpty(value);
if (value == null) return FormValidation.ok();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/scm/cvstagging/CvsTagAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.interceptor.RequirePOST;

import javax.servlet.ServletException;
import java.io.IOException;
Expand Down Expand Up @@ -106,6 +107,7 @@ public AbstractCvs getParent() {
return parentScm;
}

@RequirePOST
public synchronized void doSubmit(final StaplerRequest request, final StaplerResponse response) throws IOException,
ServletException {
// check the user is allowed to tag
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/scm/cvstagging/LegacyTagAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.interceptor.RequirePOST;
import org.netbeans.lib.cvsclient.Client;
import org.netbeans.lib.cvsclient.command.GlobalOptions;
import org.netbeans.lib.cvsclient.command.tag.TagCommand;
Expand Down Expand Up @@ -137,6 +138,7 @@ public boolean isTagged() {
/**
* Invoked to actually tag the workspace.
*/
@RequirePOST
@SuppressWarnings("unchecked")
public synchronized void doSubmit(final StaplerRequest req,
final StaplerResponse rsp) throws IOException,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry title="URL" field="url">
<f:textbox />
<f:textbox checkMethod="post"/>
</f:entry>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ THE SOFTWARE.

<d:taglib uri="local">
<d:tag name="tagForm">
<form action="submit" method="get">
<form action="submit" method="post">
<j:set var="descriptor" value="${it.descriptor}" />

<table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ THE SOFTWARE.

<d:taglib uri="local">
<d:tag name="tagForm">
<form action="submit" method="get">
<form action="submit" method="post">
<j:set var="descriptor" value="${it.descriptor}" />

<table>
Expand Down

0 comments on commit 8954b3a

Please # to comment.