SQL injection
SQL injection occurs when external data changes a database query’s structure. Binding parameters handles values, not access permissions.
SQL injection means introducing parts of SQL instructions through data processed by an application. If such values are inserted into a query's text, they can change its meaning. Which data can be read or modified depends, among other things, on the permissions of the database account used.
Separate the project filter from the query structure
A fictional ticket portal searches for entries belonging to a project reference. It treats the value from the projectRef field as a bound query parameter: the query structure is fixed, and the value is passed separately through the database interface. It should remain a search value rather than become part of SQL syntax.
Merely preparing a query after assembling it from input does not establish this separation. Previously stored data or values from other systems must not become unchecked SQL text when a later query is constructed either.
Bind values and keep structural choices fixed
A sort field such as sortKey is a different case. Placeholders for data values do not substitute for arbitrary column names or sort directions. The application therefore maps known selections to fixed columns and directions defined in code. OWASP explicitly describes this distinction between parameter binding and permitted structural choices.
Parameter binding also does not check whether the signed-in person may access the requested project. That authorisation check remains the application's responsibility. A database account limited to the necessary privileges can limit potential damage; it does not remove unsafe query construction itself.
Sources
Related terms
- DatabaseAn organised collection of data that software can access selectively and apply changes to.
- SQLA language for defining, querying and changing data.
- Object-relational mappingConnecting program objects to data in a relational database.
- Data minimisationData minimisation limits personal data to what is adequate, relevant and necessary for a defined purpose.
- Data retention policyA data retention policy defines the purpose, start, duration and end of storage. Deletion jobs and copies must be addressed in the implementation.
- Envelope encryptionEnvelope encryption separates the data key from the key protecting it. The encrypted file and wrapped data key need to be managed together.
Your project with ASES
Describe your project to us. We will get back to you with an initial assessment.