Thinking about creating a system of login and secure registration, I want to take some measures, as I have been reading, I have verified several errors that I made, especially regarding Global variables:
Ex:
I always validated my super global variables, but only those of type GET and POST, I did not care so much about COOKIE, SESSION, SERVER
.
After completing a question, the amount of errors that he committed was dropped.
Concerned mainly with SQL Injection, I now know that using PDO ( prepare, Bindvalues)
this problem is solved.
Another type of attack that was very vulnerable is XSS:
where I have never validated for global variables like SERVER, SESSION, COOKIE
, already GET e POST
I use strip_tags()
a lot. To prevent this type of attack I notice a lot of people by putting the following tags:
strip_tags, addslashes e htmlspecialchars
But I realized that some sites do not use ADDSLASHES
, is it necessary or not to prevent XSS?
I know there are several other types of attacks, but as far as super-global variables are concerned, what kind of attacks other than those mentioned above do I have to prevent? and what php functions do I have to use to prevent each attack?