Skip to content
SoftwareSolutions.net
Glossary

SQL injection

SQL injection is an attack in which malicious input changes a database query, letting an attacker read or alter data they should not reach.

Definition

SQL injection happens when an application builds database queries by joining user input directly into the query text. An attacker can type special characters that change the meaning of the query, for example to bypass a login or extract tables.

The fix is to use parameterised queries or prepared statements, which send the query and the data separately so the input can never be treated as commands. Input validation and least-privilege database accounts add further protection.

Website owners should keep their software and plugins updated and test forms for this weakness. Most modern frameworks and database libraries support parameterised queries by default.