Quiz Entry - updated: 2026.11.26
Entering a single quote ' into a login form's password field makes the application return a database error. What does that tell you?
That the input is pasted unescaped into an SQL query: the quote broke the query's syntax, so the application is very likely vulnerable to SQL injection.
Behind a login form there is often a query like:
SELECT * FROM users WHERE name = 'alice' AND password = '<input>'
With ' as input it becomes … password = '''. That is an unterminated string and a syntax error. If the database's error message reaches the browser, you have learned two things:
- The input is not parameterised or escaped. It changes the structure of the query, which is the definition of SQL injection.
- The application leaks error details, which helps an attacker refine the payload (the database type, sometimes the query itself).
The next step for an attacker is ' or '1'='1, which turns the condition into one that is always true and logs in without a password. The lab does exactly this to gain access to the vulnerable app.
Go deeper:
Computerphile: Running an SQL Injection Attack — a live demo from a single-quote error to a full login bypass.
OWASP: SQL Injection — how error messages and always-true conditions are used to probe and bypass a query.