GCIH · Question #48
Which of the following characters will you use to check whether an application is vulnerable to an SQL injection attack?
The correct answer is C. Single quote ('). The single quote is the canonical character used to test for SQL injection because it terminates string literals in SQL syntax and can expose database parsing errors.
Question
Which of the following characters will you use to check whether an application is vulnerable to an SQL injection attack?
Options
- ADash (-)
- BDouble quote (")
- CSingle quote (')
- DSemi colon (;)
How the community answered
(34 responses)- A3% (1)
- B6% (2)
- C88% (30)
- D3% (1)
Why each option
The single quote is the canonical character used to test for SQL injection because it terminates string literals in SQL syntax and can expose database parsing errors.
A dash alone does not break SQL string literals and is not a recognized standard first-step test character for SQL injection vulnerability.
A double quote is used for identifier quoting in some SQL dialects but is not the universally recognized initial probe character for SQL injection testing.
Inserting a single quote into an input field attempts to prematurely close a SQL string literal, causing a syntax error if the input is not sanitized or parameterized. A database error response confirms that raw user input is being concatenated directly into a SQL query, which is the defining indicator of SQL injection vulnerability. It is the most widely recognized and standard first-step probe for SQL injection.
A semicolon can be used to stack SQL statements in certain databases but does not directly reveal injection vulnerability on its own and is not the standard initial test character.
Concept tested: SQL injection detection using single quote character
Source: https://owasp.org/www-community/attacks/SQL_Injection
Topics
Community Discussion
No community discussion yet for this question.