Question 23 of 529
Security Assessment and TestingmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is stored cross-site scripting (XSS), because the injected JavaScript is saved on the server and executed each time the page loads for any user. This distinguishes it from reflected XSS, where the payload is not stored and only affects the immediate request. In a stored XSS attack, the tester’s input—such as a comment or search term—is persisted in a database or log and later served to other victims without proper output encoding, allowing the browser to interpret the script as part of the HTML DOM. On the CISSP exam, this scenario tests your understanding of input validation and output encoding failures within the Software Development Security domain. A common trap is confusing stored XSS with reflected XSS; remember that persistence is the key—if the script fires on page load for all users, it’s stored. Memory tip: “Stored sticks, reflected reflects”—stored XSS sticks around in the server, while reflected XSS bounces back only in the immediate response.

CISSP Security Assessment and Testing Practice Question

This CISSP practice question tests your understanding of security assessment and testing. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. 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.

During a web application security test, a tester attempts to inject JavaScript into a search field and observes that the script executes when the page is loaded. This indicates a vulnerability to:

Question 1mediummultiple choice
Full question →

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

Cross-site scripting (XSS)

The observed behavior—JavaScript injected into a search field executing when the page loads—is the hallmark of stored (persistent) cross-site scripting (XSS). In this attack, the tester's input is stored on the server (e.g., in a database or log) and later served to other users without proper output encoding, causing the browser to interpret the injected script as part of the page's HTML DOM. This directly violates the same-origin policy and allows arbitrary script execution in the context of the victim's session.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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

    Why it's wrong here

    SQL injection involves database queries, not client-side script execution.

  • Cross-site scripting (XSS)

    Why this is correct

    XSS allows injection of client-side scripts into web pages.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Command injection

    Why it's wrong here

    Command injection executes OS commands, not browser scripts.

  • Cross-site request forgery (CSRF)

    Why it's wrong here

    CSRF tricks users into performing unintended actions, not script injection.

Common exam traps

Common exam trap: answer the scenario, not the keyword

ISC2 often tests the distinction between XSS and CSRF by presenting a scenario where script execution occurs, leading candidates to confuse the client-side injection (XSS) with a cross-site request forgery (CSRF) that relies on forged requests, not injected scripts.

Trap categories for this question

  • Command / output trap

    Command injection executes OS commands, not browser scripts.

Detailed technical explanation

How to think about this question

Under the hood, XSS exploits the browser's HTML parser: when user input is inserted into the DOM without proper escaping (e.g., via innerHTML or server-side template rendering), the browser treats <script> tags as executable code. A real-world scenario is a comment field on a blog that stores unsanitized input; when another user views the page, the injected script can steal cookies (document.cookie) and exfiltrate them to an attacker-controlled server, bypassing HttpOnly flags if not set. Subtle behavior: even if the server uses Content-Type: text/html, the browser will execute scripts if the response contains unescaped user data.

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.

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

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A security team runs a vulnerability scan on a web application and discovers an unpatched SQL injection flaw. The team prioritises remediation by CVSS score — critical flaws are patched within 24 hours, high within 7 days. Questions like this test whether you understand vulnerability management processes, scanning tools, and remediation prioritisation.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related CISSP practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free CISSP 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 CISSP question test?

Security Assessment and Testing — This question tests Security Assessment and Testing — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Cross-site scripting (XSS) — The observed behavior—JavaScript injected into a search field executing when the page loads—is the hallmark of stored (persistent) cross-site scripting (XSS). In this attack, the tester's input is stored on the server (e.g., in a database or log) and later served to other users without proper output encoding, causing the browser to interpret the injected script as part of the page's HTML DOM. This directly violates the same-origin policy and allows arbitrary script execution in the context of the victim's session.

What should I do if I get this CISSP question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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 →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

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.

Loading comments…

Sign in to join the discussion.

This CISSP practice question is part of Courseiva's free ISC2 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 CISSP exam.