Log in

View Full Version : Security issue???



jnscollier
07-22-2007, 10:03 PM
So I went on vacation and just came back and i noticed some random entries in one of my database tables. the entries did not have an associated userid and were just a bunch of random letters. i know i'm relatively new to coding, so i figured i'd ask if this was some sort of hack?

i am considering outsourcing my websites now because i don't want my sites hacked... is there a relatively simple fix for something like this (for this security issue)? or a list of things i should check in the code? or am i better off putting this project on elance/rent a coder and having an experienced coder redo my sites???

thanks

Twey
07-22-2007, 10:47 PM
am i better off putting this project on elance/rent a coder and having an experienced coder redo my sites???Of course not. Then you wouldn't learn anything, would you?

So I went on vacation and just came back and i noticed some random entries in one of my database tables. the entries did not have an associated userid and were just a bunch of random letters. i know i'm relatively new to coding, so i figured i'd ask if this was some sort of hack?How should we know? It could just be a programming error.

Seeing the code in question would help, but the most common cause of security flaws is failing to properly validate user input. In PHP, this generally means running everything you receive from the user through mysql_real_escape_string() (http://www.php.net/mysql_real_escape_string) before using it in a query. More sophisticated languages tend to use an ORM to abstract database access, which will take care of this for you.
Remember, $_GET, $_POST, $_REQUEST, and $_COOKIE data can all be created or modified at any time by the user (but $_SESSION is safe).

jnscollier
07-23-2007, 04:59 PM
ok ill try out the mysql_real_escape_string