Repository navigation
Closed
Description
Current status
Currently the restricted expression evaluation mode is applied in the following scenarios (see note below):
- Pre-processing expressions:
__...__ - Unescaped output:
th:utextand inlined unescaped expressions. - All
th:on*attribute processors for JavaScript events which value is a Thymeleaf Standard Expression (see Enable processing of HTML event handler attributes in JAVASCRIPT template mode #707). th:attrattribute processor that enables the creation of variables with arbitrary name to be used elsewhere in the template.- Template and fragment names in Fragment expressions:
~{...}or contents ofth:insert,th:replace,th:includeandth:substituteby - Fragment parameters in Fragment Expressions (
~{...}orth:insert,th:replace, etc.) so that template fragments cannot be called with parameters which values come from direct user input (would be a scenario equivalent to that ofth:attr). - Default attribute processor (see Default attribute support #297), which allows the rendering of any attribute with an arbitrary name (just in case it is a JS event or anything similar)
- URL bases in Link Expressions (
@{...}) (URL parameters will not be restricted) th:srcandth:href(except URL parameters inside Link Expressions as explained above)- Output expressions in
TEXTtemplate mode, even if escaped, any use in any position (safest due to the lack of knowledge on the use it's being given).
This restricted mode applies the following restrictions:
- No access allowed to the request parameters:
${param.*}and also to any of:${#request.getParameter(...)}${#request.getParameterValues(...)}${#request.getParameterMap()}${#request.getQueryString()}${#httpServletRequest.getParameter(...)}${#httpServletRequest.getParameterValues(...)}${#httpServletRequest.getParameterMap()}${#httpServletRequest.getQueryString()}
- In
th:on*attribute processors which attribute is a Thymeleaf Standard Expression: no expression is allowed to have a result of types other than numeric or boolean.
Modifications to the restricted mode
The new restrictions to be applied would include, for all scenarios where it is applicable:
- Creation of new objects (
new ...) - Access to static code (
@identifier@in OGNL,T(identifier)in SpringEL)
Activity
Implemented #809 for OGNL-based scenarios
Added tests for the implementation of #809 in OGNL-based scenarios
Updated changelog for #809
First version of an implementation of thymeleaf/thymeleaf#809 for SpE…
Implemented thymeleaf/thymeleaf#809 for Spring 5 (SpEL)
Updated changelog for thymeleaf/thymeleaf#809 in Spring 5
Implemented thymeleaf/thymeleaf#809 for Spring 3 and 4 (SpEL)
Tests for the first version of an implementation of thymeleaf/thymele…
17 remaining items
Tests for the first version of an implementation of thymeleaf/thymele…
Restructured tests for thymeleaf/thymeleaf#809 (OGNL)
Added tests for thymeleaf/thymeleaf#809 on Spring 4 (SpEL)
Tests for the first version of an implementation of thymeleaf/thymele…
Restructured tests for thymeleaf/thymeleaf#809 (OGNL)
Added tests for thymeleaf/thymeleaf#809 on Spring 4 (SpEL)
update project to Thymeleaf 3.0.12
wrote own dialect to bypass restrictions
Spring Boot 2.2.8 -> 2.7.7
Implemented thymeleaf#809 for OGNL-based scenarios
Updated changelog for thymeleaf#809
First version of an implementation of thymeleaf/thymeleaf#809 for SpE…
Implemented thymeleaf/thymeleaf#809 for Spring 5 (SpEL)
Updated changelog for thymeleaf/thymeleaf#809 in Spring 5
Implemented thymeleaf/thymeleaf#809 for Spring 3 and 4 (SpEL)