Review 13.4 Merged

93134[BUGFIX] Fix form editor crash when editing forms in multiple browser tabs

Garvin Hicking CR +2 V +2 Normal +48 −20 updated 03/10/26, 08:52

Commit message

When editing two different forms simultaneously in separate browser
tabs, saving the first form after opening the second one caused an
exception:

  TYPO3\CMS\Form\Domain\Configuration\Exception\PropertyException
  Unauthorized modification of "prototype name" or "identifier".
  (#1528538322)

The root cause was that the form editor used a single global session
token (stored under the key `extFormProtectionSessionToken`) for HMAC
validation. Each time a form was opened for editing, `addHmacData()`
generated a new random token and overwrote the previous one. When
saving the first form, the HMAC validation failed because the token
had already been replaced by the second form's token.

The fix introduces per-form session tokens keyed by the form
persistence identifier:

- `addHmacData()` now accepts a `$formPersistenceIdentifier` parameter
  and stores the session token in a per-form token map under the
  session key `extFormProtectionSessionTokens`.
- The `_formPersistenceIdentifier` is embedded into the form definition
  payload sent to the client, so the TypeConverter can read it back
  when saving and look up the correct per-form token.
- `removeHmacData()` strips the `_formPersistenceIdentifier` before
  persisting, and the TypeConverter removes it before HMAC validation.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 1

Files 5

Review log 813

  1. Garvin Hicking commented on patch set 1 03/10/26, 05:53

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/form/Classes/Controller/FormEditorController.php * typo3/sysext/form/Classes/Domain/Configuration/FormDefinitionConversionService.php * typo3/sysext/form/Tests/Functional/Controller/FormEditorControllerTest.php * typo3/sysext/form/Tests/Functional/Mvc/Property/TypeConverter/FormDefinitionArrayConverterTest.php
  2. core-ci voted on patch set 1 V -1 03/10/26, 05:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97643

  3. Josua Vogel uploaded patch set 2 V -1 03/10/26, 06:49

  4. Josua Vogel uploaded patch set 3 03/10/26, 06:55

  5. core-ci voted on patch set 2 V -1 03/10/26, 06:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97644

  6. core-ci voted on patch set 3 V -1 03/10/26, 07:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97645

  7. Josua Vogel uploaded patch set 4 V -1 03/10/26, 07:05

  8. Josua Vogel uploaded patch set 5 03/10/26, 07:07

  9. core-ci voted on patch set 4 V -1 03/10/26, 07:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97647

  10. core-ci voted on patch set 5 V +1 03/10/26, 07:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97648

  11. Garvin Hicking marked it ready for review 03/10/26, 08:41

  12. Garvin Hicking voted on patch set 5 CR +2 V +2 03/10/26, 08:52

  13. Garvin Hicking merged patch set 6 03/10/26, 08:52