mediummultiple choiceObjective-mapped

A security analyst is investigating a series of alerts from the web application firewall. Users are reporting that when they view a product review page on the company's e-commerce site, their browser automatically redirects to a malicious website. The analyst examines the database and finds that a product review submitted by a user contains a <script> tag that loads a JavaScript file from an external domain. Which type of attack has occurred?

Question 1mediummultiple choice
Full question →

A security analyst is investigating a series of alerts from the web application firewall. Users are reporting that when they view a product review page on the company's e-commerce site, their browser automatically redirects to a malicious website. The analyst examines the database and finds that a product review submitted by a user contains a <script> tag that loads a JavaScript file from an external domain. Which type of attack has occurred?

Answer choices

Why each option matters

Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.

A

Distractor review

Cross-site request forgery (CSRF)

CSRF attacks trick a user's browser into making an unwanted request to a web application in which the user is authenticated, often resulting in actions like changing a password or making a transaction. The described scenario involves script injection and automatic redirects, not unauthorized action requests.

B

Best answer

Stored cross-site scripting (XSS)

This is correct. The injected script is permanently stored in the database (in the product review) and executes when other users view the page, which is the defining characteristic of stored (persistent) XSS.

C

Distractor review

SQL injection

SQL injection targets the database layer by manipulating SQL queries through user input. While it could be used to insert malicious scripts, the symptom described (automatic browser redirect from a web page) is directly caused by client-side script execution, not database manipulation.

D

Distractor review

Reflected cross-site scripting (XSS)

Reflected XSS involves malicious script reflected from the web server, typically via a URL parameter or form input, and it is not stored permanently. In this case, the script was found in the database and affects all users visiting the page, which indicates stored XSS.

Common exam trap

Common exam trap: answer the scenario, not the keyword

Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.

Technical deep dive

How to think about this question

This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.
  • Use explanations to understand the rule behind the answer.

TExam Day Tips

  • Underline the problem statement mentally.
  • 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.

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.

More questions from this exam

Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.

FAQ

Questions learners often ask

What does this SY0-701 question test?

Read the scenario before looking for a memorised answer.

What is the correct answer to this question?

The correct answer is: Stored cross-site scripting (XSS) — Stored cross-site scripting (XSS) occurs when an attacker injects malicious script into a web application's database, and that script is executed by the browsers of other users who view the affected page. In this scenario, the script tag persisted in the product review and executed when the page was loaded, causing the redirect. Stored XSS is more dangerous than reflected XSS because it does not require a crafted link and affects all users visiting the compromised page.

What should I do if I get this SY0-701 question wrong?

Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.

Discussion

Loading comments…

Sign in to join the discussion.