Skip to content

Commit

Permalink
Merge pull request #97 from mendix/fix/xss
Browse files Browse the repository at this point in the history
Fixed reported XSS vulnerability where url parameters were not encoded in html footer.
  • Loading branch information
grbinho authored Feb 16, 2018
2 parents ee6f269 + 9f4ec6b commit 4c960ef
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
Binary file added DIST/RestServices_mx7_5.0.1.mpk
Binary file not shown.
Binary file modified RestServices.mpr
Binary file not shown.
2 changes: 1 addition & 1 deletion javasource/restservices/RestServices.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class RestServices {
/**
* Version of the RestServices module
*/
public static final String VERSION = "5.0.0";
public static final String VERSION = "5.0.1";

/**
* Amount of objects that are processed by the module at the same time.
Expand Down
7 changes: 5 additions & 2 deletions javasource/restservices/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive;
import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive.PrimitiveType;

import org.owasp.encoder.Encode;

public class Utils {

public static String getShortMemberName(String memberName) {
Expand Down Expand Up @@ -177,9 +179,10 @@ public static String removeLeadingAndTrailingSlash(String relativeUrl) {
public static String nullToEmpty(String statusText) {
return statusText == null ? "" : statusText;
}

public static String getRequestUrl(HttpServletRequest request) {
return request.getRequestURL().toString() + (Utils.isEmpty(request.getQueryString()) ? "" : "?" + request.getQueryString());
String queryString = Encode.forUriComponent(request.getQueryString());
return request.getRequestURL().toString() + (Utils.isEmpty(queryString) ? "" : "?" + queryString);
}

public static boolean isSystemAttribute(String key) {
Expand Down
Binary file added userlib/encoder-1.2.1.jar
Binary file not shown.
Empty file.

0 comments on commit 4c960ef

Please sign in to comment.