Open codee opened 7 years ago
This appears to be true, however, I don't know how we could solve this nicely. It would require us to somehow else tell the middleware when it should check. Any ideas?
I'm not sure this problem can be solved using a middleware. In our own captcha plugin my colleague implemented a custom validation rule for the captcha which seems to be clean enough for our purposes.
This is indeed a serious issue and makes the plugin useless really. I put a project live with this plugin and received major spam in the first day. I also made a quickfix using validation. When I got time I might make a pull request with a proper fix :)
@mauserrifle could you find some time for PR or describe your fix idea?
@alxy You can solve this nicely using the following process (it's complex but solves the issue):
Since the form action collection logic is complex to build, I would actually go about giving a manual entry system where developers can enter the type of request and it's value into a list and then this list can be used to filter down requests in the middleware. This would fix the plugin and render it useful again. After that, I would figure out the best way to collect the POST actions dynamically.
@SaifurRahmanMohsin Yeah, something like this would certainly work. Would you be able to come up with a PR for this?
Hey @alxy, I do not have the time to work on this at the moment. I've got a hectic month ahead with enough client work and personal work so I've kept FOSS work on hold for now. I would suggest you do this on your own.
Correct me if I'm wrong but the check for 'g-recaptcha-response' in CaptchaMiddleware means that the captcha can be bypassed altogether simply by not including it in the request (e.g., by removing the captcha element from the DOM.)