-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing handling of SuspiciousOperationException
in RouteCollection
#50466
Comments
Hey @jnoordsij. I agree we should use 400 here. Would appreciate a PR! |
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
Would it make sense to disable the call to enableHttpMethodParameterOverride() |
This is definitely something that sounds like a reasonable follow-up in my opinion. However given this issue has been solved with #50735 I'll close this now; feel free to create a PR for your suggestion. |
Laravel Version
10.45.0 (also 11.x-dev)
PHP Version
8.3.3
Database Driver & Version
N/A
Description
Recently a request was sent to my application with
POST
method, but with the body including a (malicious)_method: __construct
parameter. By defaultHttpMethodParameterOverride
is enabled by in the Laravel request pipeline, see:framework/src/Illuminate/Http/Request.php
Lines 59 to 69 in f1fb9a6
Within the scope of handling the request, the method is then obtained within the scope of the
match
method on theRouteCollection
class, which results in aSuspiciousOperationException
being thrown here:https://github.com/symfony/symfony/blob/37d91c760bd91c431f91999c243d3d2ee76853dc/src/Symfony/Component/HttpFoundation/Request.php#L1166-L1168
After this being unhandled in any manner, the result is the application rendering a 404 response. However, this in my eyes has two issues:
Steps To Reproduce
Send a POST request to any endpoint on the application, with an "invalid" value for
_method
in the body.The text was updated successfully, but these errors were encountered: