Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BUGFIX] Cover multi-value properties in form editor with HMAC
With #85044, HMAC validation for form definitions in the backend form
editor was introduced. However, nested multi-valued options have not
been signed with corresponding HMAC values - which lead to error
messages when persisting the form again in the backend.

The exception for `_value` and `_label` (properties used for those
multi-valued items) have been removed when generating HMAC values.

Resolves: #94106
Resolves: #97235
Related: #85044
Releases: main, 11.5, 10.4
Change-Id: Iaf6798e0f5aa43bdaf90b2c1866745abaab25de1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76164
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
  • Loading branch information
ohader committed Oct 19, 2022
1 parent 5ddc640 commit 7e74747
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -64,7 +64,7 @@ public function __invoke(string $key, $value): void
GeneralUtility::makeInstance(
ArrayProcessing::class,
'addHmacData',
'^(?!(.*\._label|.*\._value)$).*',
'^.*',
GeneralUtility::makeInstance(
AddHmacDataToFormElementPropertyConverter::class,
$this->converterDto,
Expand Down
Expand Up @@ -87,6 +87,14 @@ public function addHmacDataAddsHmacHashes()
'klaus1' => [
'_label' => 'x',
'_value' => 'y',
'_orig__label' => [
'value' => 'x',
'hmac' => '8b62cd2971adeac49e8900530c9c2067a81e8b53',
],
'_orig__value' => [
'value' => 'y',
'hmac' => '582e4c76c9e6589b4ca1a85860ac774af6c5a5e0',
],
],
'sabine' => [
'heinz' => '2',
Expand Down Expand Up @@ -141,6 +149,14 @@ public function removeHmacDataRemoveHmacs()
'klaus1' => [
'_label' => 'x',
'_value' => 'y',
'_orig__label' => [
'value' => 'x',
'hmac' => '8b62cd2971adeac49e8900530c9c2067a81e8b53',
],
'_orig__value' => [
'value' => 'y',
'hmac' => '582e4c76c9e6589b4ca1a85860ac774af6c5a5e0',
],
],
'sabine' => [
'heinz' => '2',
Expand Down

0 comments on commit 7e74747

Please sign in to comment.