312-50V10 · 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 payload manipulates the SQL WHERE clause using a logical NULL condition and a comment delimiter to alter query results, which classifies it 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
(25 responses)- A8% (2)
- B16% (4)
- C4% (1)
- D72% (18)
Why each option
The injected payload manipulates the SQL WHERE clause using a logical NULL condition and a comment delimiter to alter query results, which classifies it as a tautology-based SQL injection attack.
End-of-line comment injection uses the comment delimiter such as `--` as the sole primary exploit to truncate the original query, whereas this attack's main mechanism is the injected logical condition `userid IS NULL`.
UNION SQL injection appends a second SELECT statement joined by the UNION keyword to retrieve data from additional tables, a construct that does not appear anywhere in this payload.
Illegal/Logically Incorrect Query injection deliberately submits malformed or invalid SQL syntax to trigger verbose database error messages that reveal schema information, whereas this query is syntactically valid and executes without errors.
Tautology-based SQL injection works by injecting logical conditions into a WHERE clause that manipulate the query's truth evaluation, causing the database to return rows the original query was not intended to expose. In this payload, `userid IS NULL` is injected to modify the filtering logic so the condition evaluates in the attacker's favor, while the `--` comment sequence neutralizes any remaining original query logic. Together these elements exploit the conditional structure of the SQL statement to bypass access controls or retrieve unauthorized data.
Concept tested: Tautology-based SQL injection technique identification
Source: https://owasp.org/www-community/attacks/SQL_Injection
Topics
Community Discussion
No community discussion yet for this question.