Skip to content

Commit

Permalink
Merge pull request #98 from mendix/backport/fix/xss
Browse files Browse the repository at this point in the history
Fix for XSS vunerability in rest page footer
  • Loading branch information
grbinho authored Feb 19, 2018
2 parents 67ae53f + d5baf63 commit 5b27ead
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 2 deletions.
Binary file added DIST/RestServices_mx7_4.2.3.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 = "4.2.2";
public static final String VERSION = "4.2.3";

/**
* Amount of objects that are processed by the module at the same time.
Expand Down
5 changes: 4 additions & 1 deletion 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 @@ -179,7 +181,8 @@ public static String nullToEmpty(String 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 5b27ead

Please sign in to comment.