Courseiva
Web Application and Injection AttackshardMultiple ChoiceObjective-mapped

CEH Web Application and Injection Attacks Practice Question

An attacker intercepts a request and notices that the server reflects the value of the 'User-Agent' header in the response without sanitization. The attacker crafts a payload that triggers an alert box. This is an example of:

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

Reflected XSS

Reflected XSS occurs when the application immediately returns the user input in the response; here, the User-Agent header is reflected.

Answer analysis

Option-by-option breakdown

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

  • HTTP header injection

    Why it's wrong here

    HTTP header injection involves an attacker inserting CRLF sequences into user-supplied input to add or modify HTTP headers in the server's response. While it can lead to various issues like cache poisoning or session fixation, it is distinct from XSS, which focuses on injecting executable client-side scripts into the HTML body. The vulnerability described specifically details script execution within the response content, not header manipulation.

  • DOM-based XSS

    Why it's wrong here

    DOM-based XSS occurs entirely on the client-side, where malicious script is executed due to the manipulation of the Document Object Model (DOM) by client-side scripts, often involving JavaScript. The server does not directly reflect the malicious payload in its HTTP response; instead, the vulnerability arises from unsafe handling of data within the browser itself. This type of XSS does not require server-side interaction for the payload to be introduced into the page's source.

  • Stored XSS

    Why it's wrong here

    Stored XSS, also known as Persistent XSS, involves the attacker injecting a malicious script that is permanently saved on the target server, typically in a database or file system. This stored payload is then delivered to unsuspecting users when they request the affected content, causing their browsers to execute the script. The scenario described, where the input is merely reflected in a single response, does not involve the persistence characteristic essential to stored XSS.

  • Reflected XSS

    Why this is correct

    Reflected XSS occurs when an attacker's malicious script, typically delivered via a URL parameter or HTTP header, is immediately echoed back by the web server in its HTTP response without proper sanitization. The victim's browser then interprets and executes this script as part of the legitimate page content. This non-persistent attack requires the victim to click a specially crafted link or visit a malicious site that sends the crafted request, making it a single-request, single-response vulnerability.

About these practice questions

Courseiva writes every CEH question from scratch — 870 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.