and the script runs in the browser. What vulnerability is this?","text":"A web form stores a user's comment and later displays it to other users. A tester submits and the script runs in the browser. What vulnerability is this?","answerCount":4,"acceptedAnswer":{"@type":"Answer","text":"Cross-site scripting This is cross-site scripting because untrusted input is stored and later rendered in a way that lets attacker-controlled script execute in another user's browser. The issue is the lack of proper output encoding or input handling. In practice, this can steal session cookies, alter page content, or redirect users. Recognizing that the payload runs in the browser, rather than on the database or server, points directly to XSS.\r\n\r\nWhy others are wrong: SQL injection would involve manipulating a database query, not executing browser script. CSRF abuses an authenticated user's browser to perform actions without their intent, but it does not require script execution. Command injection affects the server operating system when input reaches a shell command, which is not what this scenario describes."}}},{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What does this SY0-701 question test?","acceptedAnswer":{"@type":"Answer","text":"Read the scenario before looking for a memorised answer."}},{"@type":"Question","name":"What is the correct answer to this question?","acceptedAnswer":{"@type":"Answer","text":"The correct answer is: Cross-site scripting — This is cross-site scripting because untrusted input is stored and later rendered in a way that lets attacker-controlled script execute in another user's browser. The issue is the lack of proper output encoding or input handling. In practice, this can steal session cookies, alter page content, or redirect users. Recognizing that the payload runs in the browser, rather than on the database or server, points directly to XSS.\r\n\r\nWhy others are wrong: SQL injection would involve manipulating a database query, not executing browser script. CSRF abuses an authenticated user's browser to perform actions without their intent, but it does not require script execution. Command injection affects the server operating system when input reaches a shell command, which is not what this scenario describes."}},{"@type":"Question","name":"What should I do if I get this SY0-701 question wrong?","acceptedAnswer":{"@type":"Answer","text":"Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting."}}]}]
easymultiple choiceObjective-mapped

A web form stores a user's comment and later displays it to other users. A tester submits <script>alert(1)</script> and the script runs in the browser. What vulnerability is this?

Question 1easymultiple choice
Full question →

A web form stores a user's comment and later displays it to other users. A tester submits <script>alert(1)</script> and the script runs in the browser. What vulnerability is this?

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

SQL injection

SQL injection targets database queries, not browser execution of injected script code.

B

Distractor review

Cross-site request forgery

CSRF tricks a logged-in user into making unwanted actions, not running injected script.

C

Best answer

Cross-site scripting

The application reflects untrusted input into a page without proper encoding, allowing script execution.

D

Distractor review

Command injection

Command injection abuses server-side OS commands, not JavaScript running in a browser.

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: Cross-site scripting — This is cross-site scripting because untrusted input is stored and later rendered in a way that lets attacker-controlled script execute in another user's browser. The issue is the lack of proper output encoding or input handling. In practice, this can steal session cookies, alter page content, or redirect users. Recognizing that the payload runs in the browser, rather than on the database or server, points directly to XSS. Why others are wrong: SQL injection would involve manipulating a database query, not executing browser script. CSRF abuses an authenticated user's browser to perform actions without their intent, but it does not require script execution. Command injection affects the server operating system when input reaches a shell command, which is not what this scenario describes.

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.