Review 14.3 Merged

94426[SECURITY] Guard form_definition DataHandler access

Oliver Hader CR +2 V +2 Hard +547 −29 updated 06/09/26, 09:02

Commit message

When the database storage path for form definitions was
implemented, guarding the form_definition table against direct
DataHandler access was omitted.

This change re-implements a guard for storing in the database:

* FormDefinitionPersistenceGuard – request-scoped service
  holding pending invocation tokens. Each token covers the
  command, the record identifier, and an HMAC-SHA3-384 over
  all ksort-ordered field-pairs, binding the grant to the
  exact entity passed to DataHandler. allowInvocation()
  returns false on duplicates; consumeInvocation() enforces
  single-use after hook verification.
* FormDefinitionDataHandlerHook – registered as
  processDatamapClass and processCmdmapClass:
  - processDatamap_preProcessFieldArray verifies command,
    identifier, and field HMAC; nullifies the field array
    on mismatch.
  - processCmdmap blocks unauthorised delete commands by
    setting $commandIsProcessed = true.
* FormDefinitionRepository wraps each DataHandler call
  (add/update/remove) in allowInvocation / try-finally
  consumeInvocation, passing the exact fields sent to
  DataHandler so the hook can verify the full entity.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
  • Verified V +2 Done
    • Oliver Hader +2

Issues 1

Files 7

Review log 3

  1. Oliver Hader uploaded patch set 1 06/09/26, 09:02

  2. Oliver Hader commented on patch set 1 CR +2 V +2 06/09/26, 09:02

    Auto-approved
  3. Oliver Hader merged patch set 2 06/09/26, 09:02