Am I immune to SQL injections if I use stored procedures?

前端 未结 7 922
别那么骄傲
别那么骄傲 2020-12-09 09:36

Lets say on MySQL database (if it matters).

7条回答
  •  眼角桃花
    2020-12-09 10:03

    Additionally, consider using fine grained database access, (also called generally Role Based Access Control) The main user of your database should have exactly the permissions needed to do its job and nothing else. Don't need to create new tables after install? REVOKE that permission. Don't have a legitimate need to run as sysdba? Then don't! A sneaky injection instructing the user to "DROP DATABASE" will be stymied if the user has not been GRANTed that permission. Then all you need to worry about is data-leaking SELECT statements.

提交回复
热议问题