New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #8840 sort by sanitizing and email header injection #8841

Merged
merged 1 commit into from Apr 7, 2016
Jump to file or symbol
Failed to load files and symbols.
+24 −1
Diff settings

Always

Just for now

@@ -109,6 +109,7 @@ public ActionForward unspecified(ActionMapping rMapping, ActionForm form,
if(!UtilMethods.isSet(invalidCaptchaURL)) {
invalidCaptchaURL = errorURL;
}
invalidCaptchaURL = invalidCaptchaURL.replaceAll("\\s", " ");
ActionForward af = new ActionForward();
af.setRedirect(true);
if (UtilMethods.isSet(queryString)) {
@@ -418,6 +418,23 @@ public static WebForm sendParameterizedEmail(Map<String,Object> parameters, Set<
String subject = (String)getMapValue("subject", parameters);
subject = (subject == null) ? "Mail from " + host.getHostname() + "" : subject;
// strip line breaks from headers
from = from.replaceAll("\\s", " ");
to = to.replaceAll("\\s", " ");
cc = cc.replaceAll("\\s", " ");
bcc = bcc.replaceAll("\\s", " ");
fromName = fromName.replaceAll("\\s", " ");
subject = subject.replaceAll("\\s", " ");
String emailFolder = (String)getMapValue("emailFolder", parameters);
boolean html = getMapValue("html", parameters) != null?Parameter.getBooleanFromString((String)getMapValue("html", parameters)):true;
@@ -5,6 +5,7 @@
import java.util.Map;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.common.util.SQLUtil;
import com.dotmarketing.exception.DotDataException;
import com.dotmarketing.util.UtilMethods;
import com.liferay.portal.model.User;
@@ -100,6 +101,9 @@ public WorkflowSearcher(Map<String, Object> map, User user) {
stepId = getStringValue("stepId", map);
keywords = getStringValue("keywords", map);
orderBy = getStringValue("orderBy", map);
orderBy= SQLUtil.sanitizeSortBy(orderBy);
show4all = getBooleanValue("show4all", map);
open = getBooleanValue("open", map);
closed = getBooleanValue("closed", map);
@@ -135,7 +139,7 @@ public void setUser(User user) {
}
public String getOrderBy() {
return orderBy;
return SQLUtil.sanitizeSortBy(orderBy);
}
public List<WorkflowTask> findTasks() throws DotDataException {
@@ -154,6 +158,7 @@ public String getOrderBy() {
}
public void setOrderBy(String orderBy) {
orderBy = SQLUtil.sanitizeSortBy(orderBy);
this.orderBy = orderBy;
}
ProTip! Use n and p to navigate between commits in a pull request.