Courseiva
Web Application and Injection AttackseasyMultiple SelectObjective-mapped

CEH Web Application and Injection Attacks Practice Question

A web application tester encounters a parameter that is reflected in the response without sanitization. The tester suspects XSS. Which TWO types of XSS could be present in this scenario? (Choose TWO.)

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

DOM-based XSS

Reflected XSS occurs when the input is immediately reflected in the response. DOM-based XSS occurs when client-side JavaScript processes the input unsafely. Stored XSS requires data to be saved on the server, which is not indicated here.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • DOM-based XSS

    Why this is correct

    This vulnerability occurs entirely on the client-side when a web application's JavaScript code processes user-controllable data, often from the URL fragment (#) or query string (?), and writes it unsafely into the Document Object Model (DOM). If the client-side script dynamically generates HTML or JavaScript using this unvalidated input, an attacker can inject malicious code that executes within the victim's browser. The "reflection" happens within the browser's DOM, not necessarily on the server's response.

  • Reflected XSS

    Why this is correct

    Reflected Cross-Site Scripting occurs when a web application immediately echoes user-supplied input from an HTTP request back into the server's HTTP response without proper sanitization or encoding. An attacker crafts a malicious URL containing a script payload, which, when clicked by a victim, causes the server to embed the payload directly into the HTML page. The victim's browser then executes this script as part of the legitimate page content.

  • Self-XSS

    Why it's wrong here

    Self-XSS is not a vulnerability in the application's code but rather a social engineering tactic where a user is tricked into manually pasting malicious JavaScript code into their own browser's developer console. This attack relies on deceiving the victim into executing the script themselves, typically under the false pretense of gaining a benefit, and does not exploit any inherent flaw in how the web application handles user input or renders content.

  • Stored (persistent) XSS

    Why it's wrong here

    Stored XSS, also known as persistent XSS, involves injecting a malicious script into a web application's database or other persistent storage. Unlike reflected XSS, the payload is permanently saved on the server and subsequently delivered to other users who access the affected content, such as comments, forum posts, or profile fields. The question stem only mentions a parameter being "reflected," not stored for later retrieval by multiple users.

  • Blind XSS

    Why it's wrong here

    Blind XSS is a specialized form of stored XSS where the attacker injects a payload into an application, but the script's execution is not immediately visible or apparent to the attacker. Instead, the payload is stored and later triggered in a different, often internal or administrative, part of the application by a different user (e.g., an administrator viewing logs or support tickets). The attacker typically uses an out-of-band communication mechanism to confirm successful execution.

About these practice questions

One of 870 original CEH practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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