SQL Injection is an attack where the attacker inserts or alters SQL statements through unsanitised user input, forcing the database to execute arbitrary commands.
Variants
- In-band (Error-based, Union-based) — result returned directly.
- Blind (Boolean-based, Time-based) — information inferred indirectly.
- Out-of-band — data exfiltrated via DNS/HTTP.
Mitigation
Prepared statements, ORM usage, WAF, least-privilege DB accounts.