This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit

Abridged SQL Injection Prevention Cheat Sheet

Revision as of 08:58, 6 February 2012 by Jmanico (talk | contribs)

Jump to: navigation, search


SQL Injection is one of the most dangerous web vulnerabilities. So, much so that its the #1 item in the OWASP Top 10. It represents a serious threat because SQL Injection allows evil attacker code to change the structure of a web application's SQL statement in a way that can steal data, modify data, or potentially facilitate command injection to the underlying OS. This cheat sheet is a derivative work of the SQL Injection Prevention Cheat Sheet.

Parametrized Query Examples

SQL Injection is best prevented through the use of parameterized queries. The following chart demonstrates, with real-world code samples, how to build parameterized queries in most of the common web languages. The purpose of these code samples is to demonstrate to the web developer how to avoid SQL Injection when building database queries within an web application.

Related Articles

OWASP Cheat Sheets Project Homepage

Authors and Primary Editors

Jim Manico - jim [at]
Dave Wichers - dave.wichers [at]
Neil Matatal - neil [at]