Question 878 of 1,013
SY0-701 Threats, Vulnerabilities, and Mitigations Practice Question
An API log shows repeated requests such as `GET /api/orders?orderId=105%20OR%201=1--` followed by responses containing many customers' order records instead of one record. Which attack is most likely?
⚠ Common exam trap
The trap here is that candidates may see the word 'API' and assume the attack is related to access control or CSRF, but the presence of SQL comment syntax (`--`) and the tautology (`OR 1=1`) in the request parameter is the definitive indicator of SQL injection.
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, because the attacker is altering the database query through crafted input.
The request includes `%20OR%201=1--`, which URL-decodes to ` OR 1=1--`. This is a classic SQL injection payload that appends a tautology (`OR 1=1`) and comments out the rest of the query (`--`). The API log shows that instead of returning a single order record, the response contains many customers' order records, confirming that the injected condition bypassed the intended WHERE clause and returned all rows from the orders table.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
SQL injection, because the attacker is altering the database query through crafted input.
Why this is correct
The injected condition `OR 1=1--` is a classic indicator that user input is being interpreted as part of a database query. The application returns too much data because the attacker has manipulated the SQL logic.
- ✗
Cross-site scripting, because malicious code is being reflected in the browser.
Why it's wrong here
Cross-site scripting (XSS) is a client-side injection attack that executes malicious scripts in a victim's browser when untrusted input is included in HTML or JavaScript responses. The log entries show a server-side SQL predicate being altered via `OR 1=1--`, which affects the API's database query logic, not the user's browser. Moreover, an XSS payload would appear as script tags or event handlers in the request, but the captured payload manipulates SQL syntax to return all order records, so XSS is not the correct interpretation.
- ✗
Cross-site request forgery, because the request appears to be an unauthorized action.
Why it's wrong here
Cross-site request forgery (CSRF) leverages an authenticated victim's session to replay a forged request, often as a state-changing action like POST or PUT, and the attacker generally does not need to see the response. Here, the repeated `GET /api/orders` requests with SQL injection payloads are directly crafted by the attacker to extract data, not simply to trigger an unintended action on behalf of a logged-in user. CSRF would not embed `OR 1=1--` in the query string; instead it would use predefined parameters for a valid action the victim is authorized to perform, making this classification incorrect.
- ✗
Broken access control, because the API is not validating the user role correctly.
Why it's wrong here
Broken access control is an authorization flaw that lets a user access objects or actions beyond their permitted level, for example by changing an ID or role in the request. The attack seen in the log, however, is an injection of `OR 1=1--` into the `GET /api/orders` query parameter, which fundamentally alters the SQL statement's WHERE clause so the database returns every order. Even if the API properly validated roles, this SQL injection would still succeed because the query is constructed by concatenating raw input; the flaw is in query handling, not in role-based access validation.
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.