-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SECURITY] Use a fluid template for the ConfirmationFinisher message
The ConfirmationFinisher message is now rendered within a fluid template to allow styling of the message. Furthermore, the FormRuntime (and thus all form element values) and the finisherVariableProvider are available in the template. Custom variables can be added globally within the form setup or at form level in the form definition. By using a fluid template and the associated html escaping, the display of the ConfirmationFinisher message is protected against XSS / html injection attacks. Resolves: #84902 Releases: master, 9.5, 8.7 Security-Commit: e73ae7cae8ccc3450d850f554ab50bc09b57e716 Security-Bulletin: TYPO3-CORE-SA-2019-007 Change-Id: Id8aa02d92f6b89a3008e8c91cf8ab318a05e7489 Reviewed-on: https://review.typo3.org/59532 Reviewed-by: Oliver Hader <[email protected]> Tested-by: Oliver Hader <[email protected]>
- Loading branch information
1 parent
d578fd3
commit a0c4348
Showing
6 changed files
with
264 additions
and
5 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...Documentation/Changelog/8.7.x/Feature-83405-AddConfirmationFinisherTemplate.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
=================================================== | ||
Feature: #83405 - add ConfirmationFinisher template | ||
=================================================== | ||
|
||
See :issue:`83405` | ||
|
||
Description | ||
=========== | ||
|
||
The ConfirmationFinisher message is now rendered within a fluid template to allow styling of the message. | ||
Furthermore, the FormRuntime (and thus all form element values) and the finisherVariableProvider are available in the template [1]. | ||
Custom variables can be added globally within the form setup or at form level in the form definition [2]. | ||
By using a fluid template and the associated html escaping, the display of the ConfirmationFinisher message is protected against XSS / html injection attacks. | ||
The ext: form supplied fluid template does not include any HTML wrapping to remain compatible with existing installations, but it is possible to implement your own template [3]. | ||
|
||
[1] Template variables | ||
---------------------- | ||
|
||
* :html:`{form}` - Object for access to submitted form element values (https://docs.typo3.org/typo3cms/extensions/form/Concepts/FrontendRendering/Index.html#accessing-form-values) | ||
* :html:`{finisherVariableProvider}` - Object with data from previous finishers (https://docs.typo3.org/typo3cms/extensions/form/Concepts/FrontendRendering/Index.html#share-data-between-finishers) | ||
* :html:`{message}` - The confirmation message | ||
|
||
[2] custom template variables | ||
----------------------------- | ||
|
||
global within the form setup: | ||
|
||
.. code-block:: yaml | ||
TYPO3: | ||
CMS: | ||
Form: | ||
prototypes: | ||
standard: | ||
finishersDefinition: | ||
Confirmation: | ||
options: | ||
variables: | ||
foo: bar | ||
per form within the form definition: | ||
|
||
.. code-block:: yaml | ||
finishers: | ||
- | ||
identifier: Confirmation | ||
options: | ||
message: 'Thx' | ||
variables: | ||
foo: bar | ||
[3] custom Template | ||
------------------- | ||
|
||
form setup: | ||
|
||
.. code-block:: yaml | ||
TYPO3: | ||
CMS: | ||
Form: | ||
prototypes: | ||
standard: | ||
finishersDefinition: | ||
Confirmation: | ||
options: | ||
templateRootPaths: | ||
20: 'EXT:my_site_package/Resources/Private/Templates/Form/Finishers/Confirmation/' | ||
Impact | ||
====== | ||
|
||
Integrators can use a ConfirmationFinisher message within a fluid template. | ||
Integrators can use additional information such as form element values within the template. | ||
The ConfirmationFinisher message is protected against XSS / html injection attacks. | ||
|
||
.. index:: Frontend, ext:form, NotScanned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...sysext/form/Resources/Private/Frontend/Templates/Finishers/Confirmation/Confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
{message} | ||
</html> |