Do prepare statements secure your database?

前端 未结 4 1561
执笔经年
执笔经年 2021-01-18 01:10

I know that this question may be closed by some of you, but my question came up from you and your answers. I am reading the past two hours questions and answers for SQL Inje

4条回答
  •  有刺的猬
    2021-01-18 01:30

    This is a good discussion. Your question assumes there is one technique that will "secure your database". In fact, there is no single technique that is best for all cases. So you need to learn to use multiple solutions in different situations.

    • Escaping literal values
    • Parameter placeholders in prepared queries
    • Whitelist maps

    See my presentation SQL Injection Myths and Fallacies where I give details on everything you need to know to defend against SQL injection.

    I also cover SQL injection in my book, SQL Antipatterns: Avoiding the Pitfalls of Database Programming.

提交回复
热议问题