|
|
|
|
|
by MetaDark
2055 days ago
|
|
Just don't construct SQL queries by directly concatenating user input. It's easy to mess up or use the wrong escape function, so always use prepared statements anywhere you want to pass user defined data. You can usually grep or even use static code analysis to help find where your existing code is using "tainted" data to construct a query. Also, if you use an ORM, you'll generally be working at a high enough level where SQL injection is impossible (unless there's a bug or design flaw in the ORM); since you won't be directly dealing with text queries. |
|