Home » Vulnerabilities Knowledge Base » SQL Injection Leading to Authentication Bypass: A Hidden Entry Point
A form of web application vulnerability known as SQL Injection happens when user input is not adequately cleaned up before being incorporated into SQL queries. Without adequate validation or parameterisation, a weak login mechanism in the context of authentication simply enters user-provided values (such as the username and password) into a SQL query. Example of vulnerable SQL query:

An attacker can insert malicious SQL code to change the query’s intended logic if the application is unable to handle special characters correctly. For example, by typing:
The query becomes:
In this case, ‘1’=’1′ is always true, and the remainder of the query is commented out. By doing this, authentication is essentially circumvented, allowing the attacker to log in without legitimate credentials.
There are serious repercussions when SQL Injection occurs at the authentication endpoint:
To protect against SQL Injection and authentication bypass, developers should take the following steps:

Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...