An SQL Injection is the technique of inserting complete or partial SQL commands in user-supplied data fields of a web application and submitting them for execution by the database server. The SQL Injection is normally injected by attackers to compromise the security of a website, access private data and perform other unauthorized actions that a developer never anticipated.
Overview
Majority of businesses use website features such as contact forms, search functions, feedback fields, shopping carts and others to interact with their customers, employees and users. This allows users to legitimately submit, store or retrieve information in the website’s database. The website forms must therefore have access to the database to enable …show more content…
• Accessing the databases to find and modify security settings so as to have administrative rights.
• Using the administrative rights to perform functions such as accessing and stealing private data, deleting or modifying data in the database.
Example of an SQL Injection in a login page
When a user submits the credentials, the web application uses them in an SQL query which is then sent to the database for execution. If the submitted username and password are valid, the use gains access, and denied if invalid.
Assume the username is ‘user1’ and password is ‘pass123’, the web application will send the below SQL query to the database for verification. SELECT * FROM Users WHERE name = 'user1 ' AND password = 'pass123 '
An attacker could instead of using the valid username, submit "test ' OR 1 = 1--" as username and then use anything for the password. The SQL query in this case will look like
SELECT * FROM Users WHERE name = 'test ' OR 1 = 1 -- ' AND password = 'xxxxx '
This SQL statement will always return a true …show more content…
There are so many websites which have had these kinds of attacks in which usernames, passwords and other private data was accessed and stolen.
One such attack occurred in year 2015 on Vtech servers. The interactive toys manufacture’s servers suffered from an SQL injection attack where the hacker managed to access over 2.3 million pictures and over 4.83 million emails addresses, usernames and passwords.
Outcomes of SQL Injection
An attacker gaining administrative access is a big security risk.
• The attacker can steal, delete or alter parts or the entire data
• Launch attacks from compromised server
• Unauthorized access to all personal data or company data, confidential information, customers data etc
SQL injection takes advantage of the vulnerabilities in publicly available, user-supplied data fields in the web application. Instead of submitting anticipated information, an attacker may insert malicious code, and trick the database so that it executes the compromised statements and perform unauthorized actions such as accessing and retrieving private data, modifying or deleting parts or the entire