` into a publi…","item":"https://courseiva.com/questions/comptia/security-plus/a-user-enters-alert-test-into-a-public-comment-field-and-other"}]},{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"A user enters `` into a public comment field, and other visitors see the script run in their browsers. What attack is this?","text":"A user enters `` into a public comment field, and other visitors see the script run in their browsers. What attack is this?","answerCount":4,"acceptedAnswer":{"@type":"Answer","text":"Cross-site scripting Cross-site scripting is the correct answer because attacker-supplied script code is being stored in the application and then executed when other users view the content. This is especially common in comments, profile fields, and message boards. The important clue is that the browser runs the script, meaning the impact happens on the client side rather than in the database or login system.\r\n\r\nWhy others are wrong: SQL injection modifies backend database queries, not client-side page behavior. Broken authentication would involve issues like weak passwords or session reuse, not script execution from a comment field. Insecure deserialization is a different application flaw involving unsafe object parsing. Because the payload runs in other users' browsers, cross-site scripting is the best fit."}}},{"@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 — Cross-site scripting is the correct answer because attacker-supplied script code is being stored in the application and then executed when other users view the content. This is especially common in comments, profile fields, and message boards. The important clue is that the browser runs the script, meaning the impact happens on the client side rather than in the database or login system.\r\n\r\nWhy others are wrong: SQL injection modifies backend database queries, not client-side page behavior. Broken authentication would involve issues like weak passwords or session reuse, not script execution from a comment field. Insecure deserialization is a different application flaw involving unsafe object parsing. Because the payload runs in other users' browsers, cross-site scripting is the best fit."}},{"@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 user enters `<script>alert('test')</script>` into a public comment field, and other visitors see the script run in their browsers. What attack is this?

Question 1easymultiple choice
Full question →

A user enters `<script>alert('test')</script>` into a public comment field, and other visitors see the script run in their browsers. What attack 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

Broken authentication

Broken authentication refers to weaknesses in login or session handling, not script execution in a page.

B

Best answer

Cross-site scripting

Cross-site scripting occurs when attacker-controlled script is stored or reflected and then runs in another user's browser. A comment field that executes script for later visitors is a textbook example.

C

Distractor review

SQL injection

SQL injection targets database queries, not the browser rendering of a comment or profile field.

D

Distractor review

Insecure deserialization

Insecure deserialization involves unsafe object processing and is not the same as browser script injection.

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 — Cross-site scripting is the correct answer because attacker-supplied script code is being stored in the application and then executed when other users view the content. This is especially common in comments, profile fields, and message boards. The important clue is that the browser runs the script, meaning the impact happens on the client side rather than in the database or login system. Why others are wrong: SQL injection modifies backend database queries, not client-side page behavior. Broken authentication would involve issues like weak passwords or session reuse, not script execution from a comment field. Insecure deserialization is a different application flaw involving unsafe object parsing. Because the payload runs in other users' browsers, cross-site scripting is the best fit.

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.