SQL Injection

  • Post author:
  • Post category:General
SQL Injection


SQL Injection (SQLI) is a code injection technique. Here, the attacker adds Structured Query Language code to a web input box. SQl is the universal language of databases and the injected SQL commands, which alter SQL statements, can compromise the security of a web application. The initial discussions related to SQL injection is dated back to the late 90s. SQLI is considered as one among the major web application vulnerabilities. It is one of the common mechanisms used by hackers to steal organizational data. Most often the improper coding of web applications allowed the attackers to gain access to the database.

In other words, many web applications allow legitimate users to submit and fetch data from databases over the internet. Using the best possible SQL injection, attackers may get access to view those database contents or make any modifications. SQLI mostly targets the websites in which the inputs are not completely validated and sent database directly along with SQL query.

Mostly technologies built in dynamic script languages are more vulnerable like ASP.NET, PHP, JSP, ASP etc. Wide knowledge on SQL queries is what is required to make SQLI possible. This simplicity of SQL injection has accelerated its popularity. The attacker gains access to databases mainly because of vulnerability in the code used and the displayed results of sent SQL queries. Attackers can also be detained by implementing high security to the database.

SQL injection exploit is on the rise because of the advent of automated tools. In earlier times, the extent of the exploit was somewhat limited as the exploits had to be handled manually. Earlier an attacker had to type the SQL statement into the type box. Now it happens when a code accepts user inputs, which are directly placed in to a SQL statement. Lack of proper filtering of input characters and interactive websites are the other reasons for the increase in the number of exploit rates

SQL injection types that can be executed within a web server are:

Poorly Filtered Strings, Incorrect Type Handling, Signature Evasion, Filter Bypassing, Blind SQL Injection etc.

Considering the technicalities, you are under the risk of SQL injection if you have any applications which have not been routinely updated and patched and also if your code is not properly written. Most important precautions to be taken are data sanitization and validation. In sanitization, it has to be ensured that any submitted data should be filtered for any dangerous or unwanted characters. In validation, dangerous characters are blacklisted and only the characters allowed in the circumstances are whitelisted.

Some of the steps to mitigate SQL injection attacks are:

* Database Precautions: Use parameterised queries; restrict the web user with access only to the particular table.

* Regular updates and patches: Routine updates and application of security patches can help identify vulnerabilities.

* Firewall: Install a Web Application Firewall to help filter malicious data.

* Perform basic security measures: Change the passwords of database accounts on a regular basis.

* Coding: Always ensure your code’s functionality. Make the code writers responsible for checking the code and fix the security flaws within.

The above article narrates on how to secure your websites and in turn the databases from the exploit.

Leave a Reply