
Definition
Error-Based SQLi is a technique that takes advantage of database error messages to extract useful information about the database structure or content.
When a malicious SQL query is injected and causes an error, the application returns an error message that may reveal details like:
These messages help the attacker map out the structure of the backend database.
Vulnerable Query:
SELECT * FROM users WHERE id = '1';
Injected Input:
1' AND 1=CONVERT(int, (SELECT @@version))--
If the database returns an error like:
Conversion failed when converting the varchar value 'Microsoft SQL Server...' to data type int