- A
Cross-site scripting
Why wrong: Cross-site scripting runs script code in a user's browser, not SQL logic in a backend query.
- B
SQL injection
SQL injection happens when attacker input changes the meaning of a database query. The payload forces the login check to evaluate as true, which can bypass authentication.
- C
Session hijacking
Why wrong: Session hijacking steals or reuses an existing session token, rather than altering a database query.
- D
Insecure deserialization
Why wrong: Insecure deserialization involves unsafe object handling, not injecting SQL syntax into a form field.
SY0-701 Threats, Vulnerabilities, and Mitigations Practice Question
This SY0-701 practice question tests your understanding of threats, vulnerabilities, and mitigations. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. A key principle to apply: sQL injection manipulates backend database queries.. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A web login form returns access after a tester enters `' OR '1'='1'--` into the username field. What type of attack is this?
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 input `' OR '1'='1'--` is a classic SQL injection payload that manipulates the SQL query logic. By injecting a single quote to break out of the string context, the `OR '1'='1'` condition makes the WHERE clause always true, and the `--` comments out the rest of the query. This bypasses authentication because the database returns a valid row, granting access without a correct password.
Key principle: SQL injection manipulates backend database queries.
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 runs script code in a user's browser, not SQL logic in a backend query.
- ✓
SQL injection
Why this is correct
SQL injection happens when attacker input changes the meaning of a database query. The payload forces the login check to evaluate as true, which can bypass authentication.
Related concept
SQL injection manipulates backend database queries.
- ✗
Session hijacking
Why it's wrong here
Session hijacking steals or reuses an existing session token, rather than altering a database query.
- ✗
Insecure deserialization
Why it's wrong here
Insecure deserialization involves unsafe object handling, not injecting SQL syntax into a form field.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may confuse SQL injection with cross-site scripting because both involve injecting malicious input, but SQL injection targets the database layer via SQL syntax, while XSS targets the browser via HTML/JavaScript.
Detailed technical explanation
How to think about this question
Under the hood, the vulnerable code likely constructs a SQL query like `SELECT * FROM users WHERE username='$username' AND password='$password'`. The injected payload turns it into `SELECT * FROM users WHERE username='' OR '1'='1'--' AND password='...'`, where the `--` comments out the password check. In real-world scenarios, this attack can be mitigated by using parameterized queries (prepared statements) that separate SQL logic from data, or by input validation that rejects single quotes.
KKey Concepts to Remember
- SQL injection manipulates backend database queries.
- It often bypasses authentication or extracts sensitive data.
- Common payloads use 'OR' or 'UNION' clauses.
- Proper input validation and parameterized queries prevent SQL injection.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
SQL injection manipulates backend database queries.
Real-world example
How this comes up in practice
A security analyst at a medium-sized enterprise encounters this scenario during an investigation or architecture review. The correct answer reflects best practice for the specific threat or control described. SQL injection manipulates backend database queries. Security exam questions test whether you can match controls to threats in context — not just recall definitions.
What to study next
Got this wrong? Here's your next step.
Review sQL injection manipulates backend database queries., then practise related SY0-701 questions on the same topic to reinforce the concept.
- →
Threats, Vulnerabilities, and Mitigations — study guide chapter
Learn the concepts, then practise the questions
- →
Threats, Vulnerabilities, and Mitigations practice questions
Targeted practice on this topic area only
- →
All SY0-701 questions
1,152 questions across all exam domains
- →
Security+ SY0-701 study guide
Full concept coverage aligned to exam objectives
- →
SY0-701 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related SY0-701 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
General Security Concepts practice questions
Practise SY0-701 questions linked to General Security Concepts.
Threats, Vulnerabilities, and Mitigations practice questions
Practise SY0-701 questions linked to Threats, Vulnerabilities, and Mitigations.
Security Architecture practice questions
Practise SY0-701 questions linked to Security Architecture.
Security Operations practice questions
Practise SY0-701 questions linked to Security Operations.
Security Program Management and Oversight practice questions
Practise SY0-701 questions linked to Security Program Management and Oversight.
Security+ social engineering questions
Practise SY0-701 questions linked to Security+ social engineering questions.
Security+ cryptography practice questions
Practise SY0-701 questions linked to Security+ cryptography.
Security+ IAM questions
Practise SY0-701 questions linked to Security+ IAM questions.
Security+ risk management questions
Practise SY0-701 questions linked to Security+ risk management questions.
Security+ incident response questions
Practise SY0-701 questions linked to Security+ incident response questions.
Security+ malware questions
Practise SY0-701 questions linked to Security+ malware questions.
Security+ vulnerability management questions
Practise SY0-701 questions linked to Security+ vulnerability management questions.
Practice this exam
Start a free SY0-701 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this SY0-701 question test?
Threats, Vulnerabilities, and Mitigations — This question tests Threats, Vulnerabilities, and Mitigations — SQL injection manipulates backend database queries..
What is the correct answer to this question?
The correct answer is: SQL injection — The input `' OR '1'='1'--` is a classic SQL injection payload that manipulates the SQL query logic. By injecting a single quote to break out of the string context, the `OR '1'='1'` condition makes the WHERE clause always true, and the `--` comments out the rest of the query. This bypasses authentication because the database returns a valid row, granting access without a correct password.
What should I do if I get this SY0-701 question wrong?
Review sQL injection manipulates backend database queries., then practise related SY0-701 questions on the same topic to reinforce the concept.
What is the key concept behind this question?
SQL injection manipulates backend database queries.
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.