#90134Send 400 - BAD REQUEST on invalid hmacs from extbase forms
Description
See issue #87917.
If a bot submits a faulty extbase form (like with a manipulated __trustedProperties field), usually the following uncaught exception will be thrown:
The given string was not appended with a valid HMAC
The server will then – as with any other exception – send a status 500 back, that makes it look as if an a server error occured. This also means the error will then be automatically logged with any logging tool you are using and you would have to either manually:
- block the bots that are using the form wrong
- create a rule in your logging tool to prevent those messages from flooding your logs.
I think it would be better to just send a status code “400 – BAD REQUEST” in this case. As this actually comes from a bad client request the server can’t compute.
Reviews 7
- 11.5 74946[BUGFIX] Do not log failed HMAC validations in ext:frontend
- main 74998[BUGFIX] Do not log failed HMAC validations in ext:frontend
- 9.5 68857[BUGFIX] Do not log failed HMAC validation from forms
- 10.4 68732[BUGFIX] Do not log failed HMAC validation from forms
- main 68196[BUGFIX] Do not log failed HMAC validation from forms
- 9.5 64274[BUGFIX] Throw BadRequestException on failed hmac validation from forms
- main 63272[BUGFIX] Throw BadRequestException on failed hmac validation from forms