@@ -70,13 +70,47 @@ of seeing an empty form.
7070Security in Fluid forms
7171=======================
7272
73- Fluid automatically adds a hidden field to forms, including an `__hmac `
74- value. This value lists all allowed fields. If fields are added or
75- removed via attacks, Extbase detects the mismatch and blocks submission.
76-
77- Form fields can be grouped in an array for efficient processing. The
78- receiving action maps the data to a model, where validation occurs if
79- rules are defined. Only valid data is passed to the action and stored in
73+ Fluid automatically adds several hidden field to forms:
74+
75+ * `__referrer[] ` with an array of items `@extension `, `@controller `,
76+ `@action `, `arguments ` and `@request `. This holds information about
77+ where the form has been created, so that in case of errors,
78+ redirection to the originating Extbase controller and action
79+ (and extension) is possible.
80+ * `__trustedProperties ` (string) holds information about all used properties
81+ of all Extbase domain models that have been utilized within the
82+ related `<f:form> ` context. This is used to ensure only properties
83+ will be evaluated for persistence that have an editable form field
84+ associated with them.
85+
86+ To prevent tampering with this vital data, the important fields
87+ (`__referrer[arguments] `, `__referrer[@request] `, `__trustedProperties `)
88+ are signed with the private TYPO3 encryption key using an HMAC
89+ hash.
90+
91+ An example would look like this:
92+
93+ .. code-block :: html
94+ :caption: Example HTML rendered after Fluid processing
95+
96+ <form action =" /admin/update?token=328190ab378fe49af07d8b6b4ec31f87bd910efc" method =" post" >
97+ <div >
98+ <input type =" hidden" name =" __referrer[@extension]" value =" Beuser" >
99+ <input type =" hidden" name =" __referrer[@controller]" value =" BackendUser" >
100+ <input type =" hidden" name =" __referrer[@action]" value =" list" >
101+ <input type =" hidden" name =" __referrer[arguments]" value =" YTozOntzOjEwOiJjb250cm9sbGVyIjtzOjExOiJCYWNrZW5kVXNlciI7czo2OiJhY3Rpb24iO3M6NToiaW5kZXgiO3M6NToidG9rZW4iO3M6NDA6IjgxNWZhOGI0OGYyZDg0N2NkMzcwYWIzYTkyMjhlNDY2OWI4OTI0MmUiO30=b305f0773528375502f167cde7c6c63f6ba988f9" >
102+ <input type =" hidden" name =" __referrer[@request]" value =" {" ; @extension" ; :" ; Beuser" ; ," ; @controller" ; :" ; BackendUser" ; ," ; @action" ; :" ; list" ; }51b024523b594011fa9054f7fc82c03ead78061b" >
103+ <input type =" hidden" name =" __trustedProperties" value =" {" ; demand" ; :{" ; userName" ; :1," ; userType" ; :1," ; status" ; :1," ; logins" ; :1," ; backendUserGroup" ; :1}," ; operation" ; :1}c25fc9eb44fc0e40e8ec5cf39fc5d21022172ebf" >
104+ </div >
105+ </form >
106+
107+ If form fields are added or removed via attacks, Extbase detects the
108+ mismatch and blocks further processing.
109+
110+ Form fields can be grouped in an array for efficient processing. An
111+ internal Extbase processing action maps the received data to a model,
112+ where (optional and configurable) validation occurs.
113+ Only valid data is passed on to the action and stored in
80114the database.
81115
82116.. _typo3-fluid-form-arguments :
0 commit comments