I noticed that a bot can construct a query string to ANY url with action=logn and get a server response.
It would be better if the server only responds to a form submission.
Here is some htaccess code that may prevent it:
It seems to work when I made curl requests compared to through my website. I also tested HTTP_HOST.
I'm not sure if HTTP_HOST or SERVER_NAME can be spoofed but it would be easier than guessing IPs.
I'm wondering if the code could cause problems with third party modules or API requests?
It would be better if the server only responds to a form submission.
Here is some htaccess code that may prevent it:
Code:
RewriteCond %{QUERY_STRING} (?:^|&)action=logn [NC] RewriteCond %{SERVER_NAME} !^www.YOURDOMAIN.com RewriteRule ^.* - [F,L]
I'm not sure if HTTP_HOST or SERVER_NAME can be spoofed but it would be easier than guessing IPs.
I'm wondering if the code could cause problems with third party modules or API requests?
Comment