Saturday, July 2, 2011

SQL injection

SQL injection is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another. SQL injection is a subset of Code injection.


SELECT * From tblStock WHERE Ticker = 'Enter Stock Ticker here'

However, assume that the user enters the following:

GOOG'; drop table tblStock-- this case tblStock can be dropped

Best coding practise to prevent SQL Injection is as follow:

1. Validate all User Input

* Never build Transacent statement directlt from User Input

* When working with XML document, validate all data with its schema as sson as it is entered

2. Use parameterized Query

No comments:

Post a Comment

Your project is not referencing the "MonoAndroid,Version=v8.1" framework. Add a reference to "MonoAndroid,Version=v8.1" in the "frameworks" section of your project.json, and then re-run NuGet restore.

I had  the same problem. Reason: file obj/project.assets.json target "MonoAndroid,Version=v7.1" when my project target androi...