nerdexam
EC-Council

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.

SQL Injection

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)
  • A
    8% (2)
  • B
    16% (4)
  • C
    4% (1)
  • D
    72% (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.

AEnd of Line Comment

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`.

BUNION SQL Injection

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.

CIllegal/Logically Incorrect Query

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.

DTautologyCorrect

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

#SQL tautology#authentication bypass#SQL injection#comment injection

Community Discussion

No community discussion yet for this question.

Full 312-50V10 Practice