#102567Send 400 Bad Request in case of Extbase POST request with missing argument
Description
Given the following setup:
- An Extbase action with a required argument
- That Extbase action only will be called via POST (this can not be enforced yet, see: https://decisions.typo3.org/t/align-extbase-more-with-symfony/)
- The action is called without that argument
Right now Extbase would throw an exception: https://github.com/TYPO3/typo3/blob/v12.4.8/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php#L818
Proposal: Extbase should deliver a “400 Bad Request”.
This can happen if stupid bots crawl a site. This might spam the logs with the Extbase exception.
This can be implemented without https://decisions.typo3.org/t/align-extbase-more-with-symfony/. That than can come on top in order to enforce Extbase to only call the action if the current request is a POST request. That again prevents flooding the logs by bad bots that might call the action via get request.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 5
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2023-11-30T12:34:59+00:00" > 11/30/23, 12:34 </span>
-
Oliver Hader commented <span data-processor="relativetime" data-value="2024-08-28T13:06:01+00:00" > 08/28/24, 13:06 </span>
Simon Schaufelberger wrote in #note-1:
> This is my current solution as a workaround in a controller:
>
> […]
>
> The correct http status code is 405 in this case.Side-note: HTTP status 405 must send an additional
Allowheader in the response. -
Simon Schaufelberger changed Related to #107002 <span data-processor="relativetime" data-value="2026-02-22T17:08:51+00:00" > 02/22/26, 17:08 </span>
-
Benni Mack changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2026-08-06T16:02:21+00:00" > 08/06/26, 16:02 </span>
-
Benni Mack commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-13T17:50:19+00:00" > 11/13/26, 17:50 </span>Since TYPO3 v13.3 (#104321), mvc.showPageNotFoundIfRequiredArgumentIsMissingException = 1 turns a missing required argument into a 404, and ActionController::handleArgumentMappingExceptions() can be overridden for a different response such as 400. Restricting actions to HTTP methods (405) is tracked in #107002.
This is my current solution as a workaround in a controller:
The correct http status code is 405 in this case.