What is SQL injection?
Summary
SQL injection is a code-injection method that exploits security vunerabilities in database applications.
How SQL injection works
An application or web site with a database back-end should implement filtering on any data entered by a user, such as a web site front-end. If the data entered is not properly escaped to eliminate any database programming language code, known as SQL, then it is possible that the data entered could be executed, performing an unauthorised action on the database.
For instance, a web site could ask a user to enter some data which it will use to perform a search on a database, and if it finds anything that matches the text entered it returns the results. However by entering SQL code into the data entry field it is possible to get the code 'injected' into the query that the application is running, which could retrieve information that the user should not have access to, or to do something malicious such as changing or deleting data in the database, or even deleting the database tables.
Last word
Code-injection is a popular method of getting computer software and services to perform actions that a user does not have access to. SQL injection is a form of code-injection that targets databases.
Article date: 26th February 2011
