PDA

View Full Version : Im seriously worried about sql injection



Matt`
July 1st, 2010, 12:06
Some really clever people in this topic told me that my site can still be vulnerable to SQL injection even if I escape all inputs with the mysql_real_escape_string() function: Only the registered members can see the link.

Unfortunately, they wont reply to me when asked to explain. Could someone tell me what I'm missing, because this would make all my sites vulnerable.

Fellixombc
July 1st, 2010, 17:49
Some really clever people in this topic told me that my site can still be vulnerable to SQL injection even if I escape all inputs with the mysql_real_escape_string() function: Only the registered members can see the link.

Unfortunately, they wont reply to me when asked to explain. Could someone tell me what I'm missing, because this would make all my sites vulnerable.

I'm pretty sure mysql_real_escape_string() does the job.

If you're still worried, Only the registered members can see the link.

Justin H
July 1st, 2010, 17:51
I believe it does it's job. But just to make sure, I add the escape string + my own small security. :)

Fellixombc
July 1st, 2010, 17:54
I just used that program for any sql injections, and it found none, so you are good.

Eugene
July 1st, 2010, 19:40
Some really clever people in this topic told me that my site can still be vulnerable to SQL injection even if I escape all inputs with the mysql_real_escape_string() function: Only the registered members can see the link.

Unfortunately, they wont reply to me when asked to explain. Could someone tell me what I'm missing, because this would make all my sites vulnerable.

They didn't reply, because you said you know more about it then I do. Lol Good Luck

Matt`
July 1st, 2010, 22:18
No I didn't, I stated that you're safe from SQL injection if you use that function. If I was wrong, then you should explain your reasoning so I and others can learn from our mistakes.

Fellixombc
July 2nd, 2010, 21:30
No I didn't, I stated that you're safe from SQL injection if you use that function. If I was wrong, then you should explain your reasoning so I and others can learn from our mistakes.

You're not wrong. Look at this statement: $query = "SELECT * FROM users WHERE username = $name";
Lets say $name is a field. I simply type '; DROP TABLE users;' in for the name, and it will drop the users table.
Mysql_real_escape_string() simply removes any SQL command from the query.

Matt`
July 3rd, 2010, 10:49
You're not wrong. Look at this statement: $query = "SELECT * FROM users WHERE username = $name";
Lets say $name is a field. I simply type '; DROP TABLE users;' in for the name, and it will drop the users table.
Mysql_real_escape_string() simply removes any SQL command from the query.

Yeye that's what I thought. Thanks for clearing it up anyway, obviously people are trying to act smart by making outlandish statements with an element of mystery added to them.