SQL Injection
Summary
SQLi refers to exploitation of improper SQL query construction, allowing unauthorized access to a database.
Testing methodology
Description
SQL Injection (SQLi) occurs when an application fails to properly sanitize user-supplied input before using it in an SQL query. Attackers can manipulate the input to modify or execute unintended SQL commands, potentially leading to unauthorized access to sensitive data, data manipulation, or even remote code execution.
Remediations
- Implement parameterized queries or prepared statements to separate SQL code and user input.
- Apply strict input validation and input filtering to block or sanitize user-supplied input.
- Use least privilege principles, ensuring database accounts have limited permissions.
Usually follows
Usually precedes
Affected components
- Database
- Sensitive Information
- Session
- Server