Question 1,018 of 1,013
SY0-701 Threats, Vulnerabilities, and Mitigations Practice Question
A login form sends user input directly into a database query. When a tester enters a single quote character, the application returns a database error. What attack is most likely?
⚠ Common exam trap
Candidates often confuse the immediate error response with cross-site scripting (XSS), but the database error clearly indicates the injection is targeting the SQL layer, not the browser's DOM.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
SQL injection
The application directly concatenates user input into a database query without sanitization. Entering a single quote breaks the SQL syntax, causing a database error, which is a classic indicator of SQL injection (SQLi). This vulnerability allows an attacker to manipulate the query structure and potentially extract or modify database contents.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Cross-site scripting
Why it's wrong here
Cross-site scripting (XSS) injects malicious script into client-side content that executes in a victim's browser, typically because output is rendered without proper encoding. Here, submitting a single quote triggers a database error on the server, indicating that the input is being concatenated into a SQL query rather than reflected as HTML/JavaScript. XSS is a client-side injection; the described failure is a server-side syntax error, so the root cause is not script injection into pages.
- ✓
SQL injection
Why this is correct
This is SQL injection because the application appears to concatenate unsanitized input into a database query. A single quote often breaks query syntax and reveals that user input is being interpreted as part of the SQL command. That is a common sign the application is vulnerable to injection attacks.
- ✗
Session hijacking
Why it's wrong here
Session hijacking relies on stealing or predicting a valid session token to impersonate an authenticated user. The database error from a single quote occurs during the login query, before any session is issued or reused, and it is a direct result of malformed SQL rather than token theft. If a session were hijacked, the attacker would already possess a valid session cookie and would not trigger a SQL syntax error at the authentication step. This symptom points to an input-handling flaw, not a session-management weakness.
- ✗
Insecure deserialization
Why it's wrong here
Insecure deserialization involves processing untrusted serialized objects (e.g., Java serialization or PHP object payloads) that can lead to logic tampering or remote code execution. A login form that sends raw user input directly to a database query shows no evidence of serialized data being passed to a deserializer; instead, the single quote disrupts the SQL statement's structure, which is the signature of SQL injection. The error is produced by the database engine, not by a deserialization runtime, so this attack class cannot explain the observed behavior.
Visual reference
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
This SY0-701 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SY0-701 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.