Msg#: 4615458 posted 9:23 pm on Oct 8, 2013 (gmt 0)
I have a webform on my website that allows people to submit information to my database. At the moment, the webform has no protection.
What risks am I facing as a result of not having any protection? Is it just spam bots, or are there other risks?
And what's the best way to deal with the different risks?
I am aware that I can prevent bad bots from accessing my website by using mod_rewrite, and that I can stop bad bots from submitting information to my database by using a CAPTCHA. Are these the best methods of protection?
Msg#: 4615458 posted 11:50 pm on Oct 11, 2013 (gmt 0)
Okay, I have learnt about the following risks:
XSS injections SQL injections Spambots
To prevent XSS injections, I have used htmlentities() and strip_tags() wherever appropriate.
To prevent against SQL injections, I have used mysql_real_escape_string().
To prevent against spambots, I have used two security measures:
1) My form takes note of the time that it loads and compares it with the time that it is submitted. If less than ten seconds, the submission fails because the submission was probably made by a spambot.
2) I have added a hidden text field to my form. It's hidden by display: none. The field is called "email". If the field is populated, the submission fails because it was probably made by a spambot.
I will, of course, also ban spambots by IP address, something which I am trying to learn now.
Can you guys think of any other database security and maintenance measures?
I guess I should also back up my database every day or something.