Review main Merged

82814[BUGFIX] Properly resolve GET parameter `id`

Benni Mack CR +2 V +2 Normal +114 −3 updated 02/09/24, 06:44

Commit message

This change ensures that `?id=` only
validates against an integer-interpreted
value, disallowing `?id=nonsense23` which
previously resolved to "23"

In case an invalid `?id=` parameter value
is provided throw a page not found error.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2328

Show 23 earlier messages
  1. Benni Mack uploaded patch set 1 02/06/24, 09:07

  2. core-ci voted on patch set 1 V +1 02/06/24, 09:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52761

  3. Stefan Bürk commented on patch set 1 CR -1 02/06/24, 09:22

    on it ...
  1. Mathias Brodala commented on patch set 1 02/06/24, 09:23

    I'd vote for throwing a 404 since otherwise you have duplicate content without any option to prevent it. (Aside from e.g. adding a custom middleware, etc.) I'd also not make this configurable since it's basically the same as requesting a page ID which is hidden/deleted/etc.
  2. Benni Mack commented on patch set 1 02/06/24, 09:42

    Reply

    I agree!
  3. Stefan Bürk commented on patch set 1 02/06/24, 09:57

    Reply

    I already changed the condition to get the 404 just plumbing tests around it. Will push shortly
  4. Stefan Bürk commented on patch set 1 02/06/24, 10:00

    Reply

    At least on the page resolving - not sure on the siteconfiguration part. There I would not resolve it based on the given id so we have at least the current matched domain error handler configuration in place. What do you think ?
  5. Stefan Bürk uploaded patch set 2 CR -1 V +1 02/06/24, 10:05

  6. core-ci voted on patch set 2 V +1 02/06/24, 10:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52765

  7. Mathias Brodala commented on patch set 2 02/06/24, 10:17

    PageRouter.php:111

    Hm, isn't this a change of behavior? So far if requestId was exactly 0, then there was no direct throw here. The code below would take over instead. It makes sense to stop early, but still ...

    SiteRequestTest.php:1066

    We should also have a test for 0 (integer) here then.

    SiteRequestTest.php:1079

    "exponent"?
  8. Stefan Bürk commented on patch set 2 02/06/24, 10:41

    PageRouter.php:111 Reply

    The whole bugfix is basically a change in behaviour, and a explicitly defined ? id=0 is invalid like id=foobar - so I would take it now the same way. And not introducing a additional special handling for it. In the end, the whole ?id= handling must die in v14.0.

    SiteRequestTest.php:1066 Reply

    > We should also have a test for 0 (integer) here then. ack.
  9. Stefan Bürk uploaded patch set 3 V +1 02/06/24, 10:42

  10. Stefan Bürk commented on patch set 3 02/06/24, 10:42

    SiteRequestTest.php:1066 Reply

    Done

    SiteRequestTest.php:1079 Reply

    Done
  11. core-ci voted on patch set 3 V +1 02/06/24, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52766

  12. Mathias Brodala commented on patch set 3 02/06/24, 10:53

    PageRouter.php:111 Reply

    Acknowledged
  13. Stefan Bürk commented on patch set 3 02/06/24, 16:23

    Reply

    Done
  14. Oliver Klee voted on patch set 3 CR +1 V +1 02/06/24, 16:30

  15. Stefan Bürk voted on patch set 3 CR +1 V +1 02/06/24, 16:41

  16. Simon Schaufelberger commented on patch set 3 02/08/24, 00:31

    why not just `id`?
    an integer...
    an
    this sentence is a bit weird to read.
  17. Stefan Bürk updated the commit message in patch set 4 CR +1 V +1 02/08/24, 03:25

  18. Stefan Bürk updated the commit message in patch set 5 02/08/24, 03:26

  19. Stefan Bürk commented on patch set 5 02/08/24, 03:27

    Reply

    Done

    Reply

    Done

    Reply

    Done

    Reply

    Done
  20. core-ci voted on patch set 4 V +1 02/08/24, 03:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52874

  21. core-ci voted on patch set 5 V +1 02/08/24, 03:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52875

  22. Oliver Klee voted on patch set 5 CR +1 V +1 02/08/24, 08:52

  23. Benni Mack voted on patch set 5 CR +1 V +1 02/08/24, 20:48

  24. Stefan Bürk voted on patch set 5 CR +2 V +2 02/09/24, 06:29

  25. Stefan Bürk merged patch set 6 02/09/24, 06:44