Review main Ready for review

97623[BUGFIX] Read the backend route token from the query string first

Benni Mack CR +1 V +1 Normal +89 −2 updated 11/14/26, 00:31

Commit message

The backend route token is generated into the URL by the UriBuilder,
but RouteDispatcher read it from the request body first. As backend
Extbase forms have no field name prefix, a form named "token" sent
its data as "token[...]", which replaced the route token, was cast
to the string "Array" and failed the validation.

Letting the request body win over the query string is a common rule
(PHP's $_REQUEST, Laravel, Rails), but the route token is generated
into the URL. It is now read from the query string first, then from
the HTTP header "X-CSRF-Token", and only falls back to the request
body if a string is given there.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/23/97623/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/23/97623/2 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Oli Bartsch +1
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Oli Bartsch +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Merge conflicts 1

Issues 1

Files 2

Review log 57

  1. Benni Mack uploaded patch set 1 11/13/26, 18:04

  2. Benni Mack uploaded patch set 2 11/13/26, 18:06

  3. Oli Bartsch commented on patch set 2 11/13/26, 18:27

    RouteDispatcher.php:45

    I don't get this. Where is this token set? Do you mean `X-TYPO3-RequestToken`?
  4. core-ci voted on patch set 2 V +1 11/13/26, 19:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114369

  5. core-ci voted on patch set 1 V +1 11/13/26, 19:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114368

  6. Oli Bartsch commented on patch set 2 CR +1 V +1 11/13/26, 22:00

    RouteDispatcher.php:45 Reply

    Done
  7. Simon Schaufelberger voted on patch set 2 CR +1 V +1 11/14/26, 00:31