312-50V11 · Question #102
If an attacker uses the command SELECT*FROM user WHERE name = x' AND userid IS NULL; --; which type of SQL injection attack is the attacker performing?
The correct answer is D. Tautology. The injected condition uses a clause that evaluates to true based on a NULL comparison, classifying this as a tautology-based SQL injection attack.
Question
If an attacker uses the command SELECT*FROM user WHERE name = x' AND userid IS NULL; --; which type of SQL injection attack is the attacker performing?
Options
- AEnd of Line Comment
- BUNION SQL Injection
- CIllegal/Logically Incorrect Query
- DTautology
How the community answered
(37 responses)- A3% (1)
- B14% (5)
- C5% (2)
- D78% (29)
Why each option
The injected condition uses a clause that evaluates to true based on a NULL comparison, classifying this as a tautology-based SQL injection attack.
End-of-line comment injection uses `--` as the primary attack mechanism to strip query logic, but here the `--` is a supporting element rather than the core technique driving unauthorized data retrieval.
UNION SQL injection appends a UNION SELECT statement to merge results from a second query, which is not present in this command.
Illegal or logically incorrect query injection deliberately causes database errors to extract schema information from error messages, which is not the goal of this specific payload.
A tautology attack injects a WHERE clause condition designed to always evaluate to true or to manipulate query logic in the attacker's favor. The condition `userid IS NULL` exploits the fact that NULL IS NULL evaluates to TRUE in SQL, and the appended `--` comments out the remainder of the original query, neutralizing any closing syntax. Together, these manipulate the query's logical outcome to bypass intended filtering, which is the hallmark of tautology injection.
Concept tested: Tautology-based SQL injection classification
Source: https://owasp.org/www-community/attacks/SQL_Injection
Topics
Community Discussion
No community discussion yet for this question.