Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would change the reviser's wording to:</p> <blockquote> <p>It should be clear that to avoid SQL Injection, the application should use prepared statements, escape input, or filter application data before interpolating into an SQL string.</p> </blockquote> <p>It's not necessary to escape a value if you're going to pass as a parameter. In fact, you should not, because you'll insert literal backslashes into your data.</p> <p>You need to interpolate strings into your SQL statement when you can't use a query parameter. Examples include:</p> <ul> <li><p>Table names and column names, which have their <a href="https://stackoverflow.com/questions/214309/do-different-databases-use-different-name-quote/214344#214344">own syntax for delimited identifiers</a>. These must be part of the SQL query at prepare time, so the RDBMS can parse and validate them.</p></li> <li><p>SQL keywords, which should be sanitized but cannot be escaped because they are not delimited.</p></li> <li><p>Other syntax or expressions.</p></li> <li><p>Some cases where literal values must be provided at prepare time, e.g. MySQL's fulltext functions do not support parameters for the search pattern.</p></li> </ul> <p>Stored procedures are not a defense against SQL injection. You can prepare and execute unsafe dynamic SQL statements inside a stored procedure. See <a href="http://thedailywtf.com/Articles/For-the-Ease-of-Maintenance.aspx" rel="nofollow noreferrer">http://thedailywtf.com/Articles/For-the-Ease-of-Maintenance.aspx</a> for a great story about that.</p> <p>I cover all these cases in my presentation <a href="http://www.slideshare.net/billkarwin/sql-injection-myths-and-fallacies" rel="nofollow noreferrer">SQL Injection Myths and Fallacies</a>. That may be a helpful resource for you.</p> <p>I also cover SQL injection defense in a chapter of my book, <a href="http://pragprog.com/book/bksqla/sql-antipatterns" rel="nofollow noreferrer">SQL Antipatterns: Avoiding the Pitfalls of Database Programming</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload