Review main Merged

93335[BUGFIX] Perform access check when reading forms from database storage

Elias Häußler CR +2 V +2 Easy +34 −6 updated 03/25/26, 14:03

Commit message

Form definitions stored in the database provide granuar access control
using the `tables_select` and `tables_modify` permissions, which are
bound to a dedicated backend user and/or backend user group. Whenever a
form definition is loaded using the `DatabaseStorageAdapter`, a
permission check must be in place to assure the current user has proper
access to the database table.

With the original implementation of the database storage for EXT:form,
this access control was implemented, but not correctly applied when a
form is loaded by the form editor. This patch aims to fix that by
streamlining the implementation of
`DatabaseStorageAdapter::isAllowedPersistenceIdentifier()` with the
implementation of other existing storage adapters. It now performs an
additional check for the `tables_select` permission by calling the
already implemented `isAccessible()` method, which is also used in the
form manager to determine whether a form definition is read-only. In
addition, the `read()` method now also performs appropriate permission
checks to correctly assert the required read access for a given record.

Review

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

Issues 2

Files 2

Review log 67

  1. Elias Häußler uploaded patch set 1 03/24/26, 15:27

  2. core-ci voted on patch set 1 V +1 03/24/26, 15:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98610

  3. Garvin Hicking commented on patch set 1 CR +1 V +1 03/24/26, 20:06

    Thanks, this works for me. The exception "Read '1' not allowed" is a bit more generic because another exception is thrown on top of the more specfic one. But since it's an edge case with "malicious intent" I'm totally fine with this solution. Thanks so much for taking care.
  4. Josua Vogel commented on patch set 1 CR +1 V +1 03/25/26, 11:37

    Thanks Elias!
  5. Simon Schaufelberger voted on patch set 1 CR +1 V +1 03/25/26, 11:44

  6. Garvin Hicking voted on patch set 1 CR +2 V +2 03/25/26, 14:03

  7. Garvin Hicking merged patch set 2 03/25/26, 14:03