Glossary
What is SQL Injection?
An attack that inserts malicious SQL commands into an application's database queries through user input. It creates the risk of reading, modifying or deleting data.
SQL injection arises when an application inserts data taken from the user directly into the query text. By placing SQL statements in the input, an attacker changes the logic of the query and can gain access to unauthorized data or corrupt it.
The real fix is at the code level: parameterized queries, input validation and the principle of least privilege for database accounts. When these are not applied, the flaw can recur throughout the application.
A WAF offers an additional layer of protection by blocking requests that contain known injection patterns; however, it can miss new or obfuscated forms. It is therefore not a lasting measure. The vulnerability is covered under the injection category in the OWASP Top 10. For a similar class of attack that runs on the client side, see the term XSS.