Difference between revisions of "Query Parameterization Cheat Sheet"

From OWASP
Jump to: navigation, search
m (Parametrized Query Examples)
m
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
  
[[SQL Injection]] is one of the most dangerous web vulnerabilities. So, much so that its the [[Top_10_2010-A1|#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]].
+
[[SQL Injection]] is one of the most dangerous web vulnerabilities. So much so that it's the [[Top_10_2010-A1|#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]].
  
 
= Parameterized Query Examples =
 
= Parameterized Query Examples =
Line 81: Line 81:
 
  '''$sth->execute( $bar, $baz );'''
 
  '''$sth->execute( $bar, $baz );'''
 
|}
 
|}
 
= Related Articles =
 
 
{{Cheatsheet_Navigation}}
 
  
 
= Authors and Primary Editors  =
 
= Authors and Primary Editors  =
Line 91: Line 87:
 
Dave Wichers - dave.wichers [at] aspectsecurity.com<br/>
 
Dave Wichers - dave.wichers [at] aspectsecurity.com<br/>
 
Neil Matatal - neil [at] owasp.org
 
Neil Matatal - neil [at] owasp.org
 +
 +
= Other Cheatsheets =
 +
{{Cheatsheet_Navigation}}
  
 
[[Category:Cheatsheets]]
 
[[Category:Cheatsheets]]

Revision as of 05:35, 9 July 2012

Contents

Introduction

SQL Injection is one of the most dangerous web vulnerabilities. So much so that it's 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.

Parameterized 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.

Authors and Primary Editors

Jim Manico - jim [at] owasp.org
Dave Wichers - dave.wichers [at] aspectsecurity.com
Neil Matatal - neil [at] owasp.org

Other Cheatsheets

OWASP Cheat Sheets Project Homepage

Developer Cheat Sheets (Builder)

Assessment Cheat Sheets (Breaker)

Mobile Cheat Sheets

OpSec Cheat Sheets (Defender)

Draft Cheat Sheets