Courseiva
Web Application and Injection AttackshardMultiple ChoiceObjective-mapped

CEH Web Application and Injection Attacks Practice Question

An analyst reviews the following HTTP response: HTTP/1.1 200 OK Set-Cookie: sessionid=abc123; SameSite=None; Secure ... <html><body><p>Welcome back!</p></body></html>. What possible vulnerability exists if the application does not use CSRF tokens?

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 request forgery (CSRF)

SameSite=None allows cross-site requests to include cookies, making CSRF possible if no CSRF tokens are used. SameSite=Lax or Strict would block some CSRF attacks.

Answer analysis

Option-by-option breakdown

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

  • Cross-site request forgery (CSRF)

    Why this is correct

    Cross-site request forgery (CSRF) is a vulnerability where an attacker tricks an authenticated user into submitting an unintended request to a web application. If the HTTP response implies that session cookies are sent on cross-site requests (e.g., via SameSite=None without Secure or HttpOnly flags) and the application lacks anti-CSRF tokens, the application becomes susceptible. An attacker can craft a malicious page that, when visited by the victim, forces their browser to send a request to the vulnerable site, leveraging the victim's active session.

  • Clickjacking

    Why it's wrong here

    Clickjacking involves tricking a user into clicking on an invisible element on a web page, typically by overlaying a malicious transparent iframe over a legitimate page element. While the absence of X-Frame-Options or Content-Security-Policy: frame-ancestors headers in an HTTP response could allow framing, the simple "http 1 1 200" status line alone provides no information about the page's content, its framing capabilities, or the presence of an actual clickjacking exploit. Therefore, this response does not directly indicate a clickjacking vulnerability.

  • Cross-site scripting (XSS)

    Why it's wrong here

    Cross-site scripting (XSS) vulnerabilities arise when a web application incorporates untrusted user-supplied data into its output without proper sanitization, allowing malicious scripts to be executed in the victim's browser. The provided HTTP response "http 1 1 200" is merely the status line and contains no response body or headers that would reveal reflected user input or potential script injection points. Without evidence of user input being rendered unsafely, XSS cannot be inferred from this minimal information.

  • Session fixation

    Why it's wrong here

    Session fixation is an attack where an attacker establishes a valid session ID with a server and then tricks a user into authenticating with that pre-determined session ID. After the user logs in, the attacker can hijack the session using the known ID. The "http 1 1 200" response provides no details about session ID generation, management, or the authentication process, which are critical factors in identifying session fixation vulnerabilities. This response alone offers no indication of such an attack vector.

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

Same concept, more angles

1 more way this is tested on CEH

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A security analyst is reviewing HTTP response headers and notices the following: Set-Cookie: sessionId=abc123; SameSite=Lax. What is the primary purpose of the SameSite attribute?

medium
  • A.To enforce HTTPS for cookie transmission
  • B.To prevent the cookie from being accessed by JavaScript
  • C.To mitigate cross-site request forgery (CSRF) attacks
  • D.To ensure the cookie is only sent over HTTP and not FTP

Why C: SameSite=Lax prevents the browser from sending the cookie in cross-site requests initiated by third-party websites, mitigating CSRF attacks.

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.