Skip to content

Commit 8add4fd

Browse files
Fixes #255 - Incorrect double-unescaping of request parameters breaks restricted mode check on view name presence
1 parent bb45fcc commit 8add4fd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

thymeleaf-spring3/src/main/java/org/thymeleaf/spring3/util/SpringRequestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void checkViewNameNotInRequest(final String viewName, final HttpSe
5252
while (!found && paramNames.hasMoreElements()) {
5353
paramValues = request.getParameterValues(paramNames.nextElement());
5454
for (int i = 0; !found && i < paramValues.length; i++) {
55-
paramValue = StringUtils.pack(UriEscape.unescapeUriQueryParam(paramValues[i]));
55+
paramValue = StringUtils.pack(paramValues[i]);
5656
if (paramValue.contains(vn)) {
5757
found = true;
5858
}

thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/util/SpringRequestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void checkViewNameNotInRequest(final String viewName, final HttpSe
5252
while (!found && paramNames.hasMoreElements()) {
5353
paramValues = request.getParameterValues(paramNames.nextElement());
5454
for (int i = 0; !found && i < paramValues.length; i++) {
55-
paramValue = StringUtils.pack(UriEscape.unescapeUriQueryParam(paramValues[i]));
55+
paramValue = StringUtils.pack(paramValues[i]);
5656
if (paramValue.contains(vn)) {
5757
found = true;
5858
}

thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringRequestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void checkViewNameNotInRequest(final String viewName, final HttpSe
5252
while (!found && paramNames.hasMoreElements()) {
5353
paramValues = request.getParameterValues(paramNames.nextElement());
5454
for (int i = 0; !found && i < paramValues.length; i++) {
55-
paramValue = StringUtils.pack(UriEscape.unescapeUriQueryParam(paramValues[i]));
55+
paramValue = StringUtils.pack(paramValues[i]);
5656
if (paramValue.contains(vn)) {
5757
found = true;
5858
}

0 commit comments

Comments
 (0)