Skip to content

Commit

Permalink
bugid: added security fix
Browse files Browse the repository at this point in the history
CR_By: n/a
  • Loading branch information
iland committed Aug 12, 2018
1 parent b879d27 commit 558d126
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/checkmarx/jenkins/CxScanBuilder.java
Expand Up @@ -37,6 +37,7 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.kohsuke.stapler.*;
Expand Down Expand Up @@ -1483,7 +1484,7 @@ public ListBoxModel doFillPresetItems(@QueryParameter final boolean useOwnServer
// timestamp is not used in code, it is one of the arguments to invalidate Internet Explorer cache
ListBoxModel listBoxModel = new ListBoxModel();
try {
CxCredentials credentials = CxCredentials.resolveCredentials(!useOwnServerCredentials, serverUrl, username, getPasswordPlainText(password), credentialsId, this, item);
CxCredentials credentials = CxCredentials.resolveCredentials(!useOwnServerCredentials, serverUrl, username, StringEscapeUtils.escapeHtml4(getPasswordPlainText(password)), credentialsId, this, item);
CxShragaClient shragaClient = prepareLoggedInClient(credentials);

//todo import preset
Expand Down Expand Up @@ -1526,7 +1527,7 @@ public ListBoxModel doFillSourceEncodingItems(@QueryParameter final boolean useO
ListBoxModel listBoxModel = new ListBoxModel();
try {

CxCredentials credentials = CxCredentials.resolveCredentials(!useOwnServerCredentials, serverUrl, username, getPasswordPlainText(password), credentialsId, this, item);
CxCredentials credentials = CxCredentials.resolveCredentials(!useOwnServerCredentials, serverUrl, username, StringEscapeUtils.escapeHtml4(getPasswordPlainText(password)), credentialsId, this, item);

CxShragaClient shragaClient = prepareLoggedInClient(credentials);
List<CxNameObj> configurationList = shragaClient.getConfigurationSetList();
Expand Down Expand Up @@ -1556,7 +1557,7 @@ public ListBoxModel doFillGroupIdItems(@QueryParameter final boolean useOwnServe
// timestamp is not used in code, it is one of the arguments to invalidate Internet Explorer cache
ListBoxModel listBoxModel = new ListBoxModel();
try {
CxCredentials credentials = CxCredentials.resolveCredentials(!useOwnServerCredentials, serverUrl, username, getPasswordPlainText(password), credentialsId, this, item);
CxCredentials credentials = CxCredentials.resolveCredentials(!useOwnServerCredentials, serverUrl, username, StringEscapeUtils.escapeHtml4(getPasswordPlainText(password)), credentialsId, this, item);

CxShragaClient shragaClient = prepareLoggedInClient(credentials);
List<Team> teamList = shragaClient.getTeamList();
Expand Down

0 comments on commit 558d126

Please sign in to comment.