![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Due to my general paranoia, I would like to ask if there are any good practices that I have not listed and should follow. I am talking about SQL related stuff, not ideas like "do not pass user parameters into popen()". |
#3
| |||
| |||
|
|
I have always been slightly paranoid about sql injections. To that end, I am following certain practices, such as: 1) all user input (received from forms, URLs or even file names) is always quoted with $dbh->quote() function. In ADDITION to this, parameters that should be, say, numeric, are so asserted. 2) All stored user passwords are encrypted with mysql PASSWORD() function, not stored in plain text. 3) All read only access (SELECTs) is done with a database handle that has only SELECT grant (a read only handle). Idea #3 is mine and I really like it, this means that if someone could subvert some SELECT statement, they could not alter a database in any way. (inject a "DROP TABLE users" type of statement) Due to my general paranoia, I would like to ask if there are any good practices that I have not listed and should follow. I am talking about SQL related stuff, not ideas like "do not pass user parameters into popen()". |
#4
| |||
| |||
|
|
On 2011-02-12 04:27, Ignoramus20766 wrote: [...] Due to my general paranoia, I would like to ask if there are any good practices that I have not listed and should follow. I am talking about SQL related stuff, not ideas like "do not pass user parameters into popen()". Use prepared statements. |
#5
| |||
| |||
|
|
Due to my general paranoia, I would like to ask if there are any good practices that I have not listed and should follow. I am talking about SQL related stuff, not ideas like "do not pass user parameters into popen()". |
![]() |
| Thread Tools | |
| Display Modes | |
| |