#106851Form Validation fails with "token" as Form Name
Description
Description
If you set the name of an Extbase form, in my case that of a backend controller, to “token”, the validation of the form always fails.
Example
<f:form action="verifyPin" name="token" object="{token}">
...
</f:form>
Preliminary error analysis
Since the request token is apparently always transmitted as a GET parameter, the simplest solution would probably be to swap the order of this POST-GET parameter check.
Reviews 1
History 24
-
Benni Mack changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2026-08-06T16:02:29+00:00" > 08/06/26, 16:02 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 97623 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-13T18:04:49+00:00" > 11/13/26, 18:04 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97623 <span data-processor="relativetime" data-value="2026-11-13T18:06:13+00:00" > 11/13/26, 18:06 </span>
Analysis
On main,
RouteDispatcher::isValidRequest()reads the route token from the parsed body first and from the query string only as a fallback:Backend Extbase forms have no field name prefix, so
<f:form name="token">sendstoken[...]in the body. That array wins over the route token, whichUriBuilderalways puts into the query string. It is then cast to"Array"and the check fails.Letting POST win over GET is a common rule. PHP’s
$_REQUEST(request_order = "GP"), Laravel’s$request->input()and Rails’paramsall do that. Symfony and Django keep both sources separate, and Symfony removed the mergingRequest::get()in 8.0. The route token, however, is generated into the URL, so it should be read from there.GET links have the same problem: the backend
UriBuilderadds the token with['token' => ...] + $parameters, so atokenparameter passed in by the caller replaces the generated route token.Option 1: Read the query string first (bugfix, main + 14.3)
tokenfrom the query string first.tokenas a plain form field keep working.Option 2: Rename the route token to
_token(breaking, main only)_tokeninstead oftoken, similar to_tokenin Symfony and Laravel or Extbase’s reserved__referrerand__trustedProperties.tokenas a deprecated fallback in v15, so old URLs, open tabs and hand-built links keep working. Remove the fallback in v16.tokenfrom a backend request or removetokenfrom generated URLs by name (as core does in several places). Needs a Breaking changelog entry and a separate issue.Proposal: do option 1 as the bugfix for this issue. Option 2 can follow on main under a separate issue.