Skip to content

Commit 4c960ef

Browse files
authored
Merge pull request #97 from mendix/fix/xss
Fixed reported XSS vulnerability where url parameters were not encoded in html footer.
2 parents ee6f269 + 9f4ec6b commit 4c960ef

File tree

6 files changed

+6
-3
lines changed

6 files changed

+6
-3
lines changed

DIST/RestServices_mx7_5.0.1.mpk

855 KB
Binary file not shown.

RestServices.mpr

0 Bytes
Binary file not shown.

javasource/restservices/RestServices.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class RestServices {
2020
/**
2121
* Version of the RestServices module
2222
*/
23-
public static final String VERSION = "5.0.0";
23+
public static final String VERSION = "5.0.1";
2424

2525
/**
2626
* Amount of objects that are processed by the module at the same time.

javasource/restservices/util/Utils.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive;
2828
import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive.PrimitiveType;
2929

30+
import org.owasp.encoder.Encode;
31+
3032
public class Utils {
3133

3234
public static String getShortMemberName(String memberName) {
@@ -177,9 +179,10 @@ public static String removeLeadingAndTrailingSlash(String relativeUrl) {
177179
public static String nullToEmpty(String statusText) {
178180
return statusText == null ? "" : statusText;
179181
}
180-
182+
181183
public static String getRequestUrl(HttpServletRequest request) {
182-
return request.getRequestURL().toString() + (Utils.isEmpty(request.getQueryString()) ? "" : "?" + request.getQueryString());
184+
String queryString = Encode.forUriComponent(request.getQueryString());
185+
return request.getRequestURL().toString() + (Utils.isEmpty(queryString) ? "" : "?" + queryString);
183186
}
184187

185188
public static boolean isSystemAttribute(String key) {

userlib/encoder-1.2.1.jar

35.8 KB
Binary file not shown.

userlib/encoder-1.2.1.jar.RestServices.RequiredLib

Whitespace-only changes.

0 commit comments

Comments
 (0)