Glossary
SQL injection
Definition
SQL injection happens when unsafe handling of input lets an attacker change the database commands an application runs.
The flaw is in how an application builds database requests. It can allow unauthorised reading or changes within the database account's permissions.
A customer may include “SQL injection” in a supplier security questionnaire or spreadsheet. They want to understand whether this topic affects the service you provide and what safeguards or evidence support your answer.
SQL injection is a weakness that allows supplied input to alter a database command. SQL is the language many applications use to request or change stored information. If an application treats outside input as part of that language, a request can do more than its designer intended.
Possible consequences include exposing records, changing information or bypassing an intended access check. The exact damage depends on the query and the database permissions available to the application. A database does not need to be directly accessible from the internet for a public-facing application to expose it.
Hypothetical example: a small membership website builds a database search by inserting form input directly into a command. An attacker changes the meaning of the request and retrieves records that should not appear in the search results.
Use parameterised queries so input cannot change the structure of a database command, and give the application only the permissions it needs. Filtering traffic can reduce some attempts but does not fix unsafe queries. Tests should cover application code and later release changes.
Sources: OWASP SQL injection prevention.