Review main Merged

93096[BUGFIX] Render honeypot as last element of the form step

Josua Vogel CR +2 V +2 Easy +23 −10 updated 10/19/26, 20:39

Commit message

The honeypot element was inserted at a random position among the
elements of the current form step on every rendering. On uncached
pages its position therefore changed with every page load.

Firefox restores the values of form controls after a soft reload by
the index of the control within the form, not by its name. When the
honeypot moved, restored values ended up in the neighbouring field
and could even end up in the honeypot itself, failing its validation.

The honeypot is now appended as last element of the form step. Its
random name, which the spam protection relies on, is kept.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Oliver Klee +1
    • Guido Schmechel +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Oliver Klee +1
    • Guido Schmechel +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1519

  1. Josua Vogel uploaded patch set 1 03/05/26, 21:47

  2. Josua Vogel updated the commit message in patch set 2 03/05/26, 21:47

  3. Josua Vogel marked it work in progress 03/05/26, 21:48

  4. core-ci voted on patch set 2 V +1 03/05/26, 22:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97447

  5. core-ci voted on patch set 1 V +1 03/05/26, 22:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97446

  6. Garvin Hicking commented on patch set 2 03/14/26, 21:23

    Did you maybe find anything in the Firefox bugtrackers on this? To me this sounds like a browser bug that form values are restored by some DOM order instead of utilizing name/id resolving?!
  7. Josua Vogel abandoned the change 10/16/26, 20:09

  8. Josua Vogel restored the change 10/16/26, 20:32

  9. Josua Vogel uploaded patch set 3 V +1 10/16/26, 20:32

  10. Josua Vogel commented on patch set 3 10/16/26, 20:33

    This change is ready for review.

    Reply

    with the help of AI: It is how Firefox keys restored form state, not a bug likely to be fixed there: nsContentUtils::GenerateStateKey builds the key for a control inside a <form> from control type, form number, the control's index within the form and the form name. The control's own name is only used for controls outside a form (Mozilla's own comment there questions the index-based key, but it has stayed). So a honeypot changing its position shifts the index of every following control, and Firefox restores the values into the neighbouring fields — or into the honeypot itself, which then fails its EmptyValidator. Source: https://searchfox.org/firefox-main/source/dom/base/nsContentUtils.cpp (GenerateStateKey)
  11. Josua Vogel updated the commit message in patch set 4 10/16/26, 20:34

  12. core-ci voted on patch set 4 V +1 10/16/26, 20:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111397

  13. core-ci voted on patch set 3 V +1 10/16/26, 20:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111396

  14. Simon Schaufelberger voted on patch set 4 CR +1 V +1 10/16/26, 21:01

  15. Georg Ringer voted on patch set 4 CR +1 V +1 10/17/26, 05:31

  16. Guido Schmechel voted on patch set 4 CR +1 V +1 10/17/26, 10:31

  17. Oliver Klee voted on patch set 4 CR +1 V +1 10/17/26, 17:04

  18. Georg Ringer voted on patch set 4 CR +2 V +2 10/19/26, 20:39

  19. Georg Ringer merged patch set 5 10/19/26, 20:39