10
Thinking about creating a secure login and registration system, I want to take some measures, as I’ve been reading, I check several errors I committed, mainly regarding Global variables:
http://php.net/manual/en/language.variables.superglobals.php
Ex:
I always validated my super global variables, but only the GET and POST types, I didn’t worry so much about COOKIE, SESSION, SERVER
.
After performing a question dropped the amount of errors that made.
Mainly concerned with SQL Injection, now know that using PDO ( prepare, Bindvalues)
this problem is solved.
Another type of attack that was very vulnerable is the XSS:
where I’ve never been to global variables like SERVER, SESSION, COOKIE
, already GET e POST
I use the strip_tags()
. To prevent this type of attack I notice many people putting the following tags:
strip_tags, addslashes e htmlspecialchars
But I noticed that some sites do not use the ADDSLASHES
, is necessary or not to prevent XSS ?
I know there are several other types of attacks, but when it comes to the super global variables, what kind of attacks besides the ones mentioned above do I have to prevent? and what php functions I have to use to prevent each attack?
In addition to those cited CSRF found, in which we can use a SESSION with a unique identifier, which will be checked on the page that receives the post get method etc... There are other ways to prevent this attack...
– abcd