Disable Form Tampering Protection for comment forms (fixes #1809) #2820
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CakePHP's
FormHelper
uses a SHA1 HMAC signature to protect hidden fields against modification by malicious users. The signature also covers thesession_id
, which means that if thesession_id
changes, all previously loaded forms break.For the comment forms, the only hidden field is the
sentence_id
. Being able to modify it doesn't grant malicious users any interesting capabilities. If they want to post a comment on a different sentence, they can already do that.I'm not sure whether this protection should be enabled for any form. There are a few other issues mentioning black-holed requests when submitting a form: #1922, #1955, #2198. I'd hope that in each case the form is validated on the backend and changing parameters on the frontend won't allow bypassing that even without the signature. But I guess it's nice to have in principle, as a kind of defense-in-depth?