Review main Merged

80379[BUGFIX] Keep the honeypot name in the form state

Tim Schreiner CR +2 V +2 Hard +163 −103 updated 10/16/26, 17:44

Commit message

The honeypot of ext:form was only validated if the name of the
honeypot field could be read from the frontend session. Without a
session cookie - bots usually send none, and cached pages never set
one - no validator was added and the honeypot was bypassed.

The honeypot name is now stored per page in the HMAC-signed form
state that is rendered with the form, and read from it on submit.
If the honeypot is enabled but the submitted state carries no name,
the submission is rejected and the form step is shown again, as on
a filled honeypot.

Displaying a form no longer writes into the anonymous frontend
session, and the honeypot also works on cached pages and with
static file caching. The documentation is adjusted accordingly.

Forms rendered before this change carry no honeypot name in their
state and are shown again once on submit. Page caches, including
static file caches, should be flushed after the update, otherwise
cached forms keep being rejected.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Josua Vogel +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Josua Vogel +1
    • core-ci +1 CI

Issues 3

Files 6

Review log 2740

Show 1015 earlier messages
  1. Tim Schreiner uploaded patch set 1 08/03/23, 22:28

  2. core-ci voted on patch set 1 V -1 08/03/23, 22:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45011

  3. Tim Schreiner uploaded patch set 2 V -1 08/04/23, 08:32

  4. core-ci voted on patch set 2 V -1 08/04/23, 08:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45028

  5. Tim Schreiner commented on patch set 2 08/04/23, 08:51

    The intention of this MR is to fix this bug. There might be better solution that needs more code and maybe new concepts, but this bug currently leads to spam problems in forms because the honeypot could easily be bypassed when there is no cookie set.

    AbstractExceptionHandler.php:50

    I would like to exclude the exception in the logging because bots might spam the logs when trying to send forms.

    FormRuntime.php:420

    I removed the page identifier as part of the session identifier which holds the honeypot name because it might break the form handling. The honeypot name is generated on the first form call (GET). When the form request is once submitted, the honeypot name will be fetched from the request/session. With the included page identifier, the initial honeypot name is generated for page-1. When the for got submitted from page-2, there is no session identifier holding the honeypot name for this page and it is empty. This might be the reason, why the condition for the honeypot evaluation exists in the first place. But I'm not sure, if my change leads to another set of problems. I would be happy if someone could evaluate this.

    FormRuntime.php:428

    There might be a better solution than throwing an exception, but when there is no honeypot name, there is no element to bind a validation error to. Maybe it is an option to add a validation error to the form object itself instead of a child node.
  6. Tim Schreiner commented on patch set 2 08/04/23, 13:05

    Another problem is, that the form framework CE is cached. Therefore the session cookie is not set and there is no unique name for the honeypot field generated. I suggest thinking about changing the behaviour, how the honeypot name is generated. Maybe the name for the honeypot could be an hmac. Therefore the name would be different between systems but could be build anytime it needs to. There would be no need to store it in a session.
  7. Tim Schreiner uploaded patch set 3 V -1 08/04/23, 13:24

  8. Tim Schreiner updated the commit message in patch set 4 08/04/23, 13:29

  9. Tim Schreiner commented on patch set 4 08/04/23, 13:33

    I have updated this review and changed the handling of the honeypot name. The honeypot name is now generated using a static string from that an hmac is build. There is no need to store this in the session because it can be regenerated. This is not a perfect solution but it should be an improvement to the current state in which the honeypot is getting ignored when no honeypot name could be fetched from the session.

    AbstractExceptionHandler.php:50 Reply

    Done

    FormRuntime.php:420 Reply

    Done

    FormRuntime.php:428 Reply

    Done
  10. core-ci voted on patch set 3 V +1 08/04/23, 13:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45068

  11. core-ci voted on patch set 4 V +1 08/04/23, 13:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45070

  12. Tim Schreiner uploaded patch set 5 V +1 08/04/23, 13:37

  13. core-ci voted on patch set 5 V +1 08/04/23, 13:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45071

  14. Oliver Wand voted on patch set 5 CR +1 08/04/23, 15:55

  15. Tim Schreiner rebased onto patch set 6 CR +1 V +1 03/04/24, 14:36

  1. core-ci voted on patch set 6 V +1 03/04/24, 14:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53857

  2. Benni Mack updated the commit message in patch set 7 V +1 10/18/24, 13:23

  3. core-ci voted on patch set 7 V -1 10/18/24, 19:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67960

  4. Benni Mack wrote 03/28/25, 09:18

    Topic set to form
  5. Thomas Löffler voted on patch set 7 CR +1 01/19/26, 10:19

  6. Josua Vogel uploaded patch set 8 CR +1 V -1 03/06/26, 10:12

  7. core-ci voted on patch set 8 V +1 03/06/26, 10:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97481

  8. Josua Vogel updated the commit message in patch set 9 V +1 03/06/26, 12:29

  9. core-ci voted on patch set 9 V +1 03/06/26, 13:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97497

  10. Benni Mack updated the commit message in patch set 10 V +1 04/22/26, 06:41

  11. core-ci voted on patch set 10 V -1 04/22/26, 11:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100764

  12. Georg Ringer uploaded patch set 11 V -1 09/28/26, 21:09

  13. core-ci voted on patch set 11 V -1 09/28/26, 21:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109460

  14. Georg Ringer rebased onto patch set 12 V -1 09/28/26, 21:25

  15. core-ci voted on patch set 12 V +1 09/28/26, 21:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109463

  16. Josua Vogel uploaded patch set 13 V +1 10/15/26, 21:44

  17. Josua Vogel commented on patch set 13 10/15/26, 21:45

    I changed the fix to a slightly different approach. If you don´t like it, feel free to roll back
  18. core-ci voted on patch set 13 V +1 10/15/26, 21:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111284

  19. Josua Vogel voted on patch set 13 CR +1 V +1 10/15/26, 21:56

  20. Georg Ringer voted on patch set 13 CR +2 V +2 10/16/26, 06:25

  21. Georg Ringer commented on patch set 13 CR -2 10/16/26, 06:39

    need to check
  22. Georg Ringer commented on patch set 13 CR 0 V 0 10/16/26, 13:47

    not so sure about it ---- Weaker protection with the new approach. The honeypot name is no longer bound to the session. A bot can save a valid state together with its honeypot name and reuse it as often as it likes. With static file caching, the name is the same for every visitor. The changelog states this openly, and it is still better than no validation at all. But the "rotating" property of the honeypot is lost.
  23. Georg Ringer voted on patch set 13 CR +1 V +1 10/16/26, 17:44

  24. Georg Ringer voted on patch set 13 CR +2 V +2 10/16/26, 17:44

  25. Georg Ringer merged patch set 14 10/16/26, 17:44