EC-Council Certified Ethical Hacker (CEH) v12Web Application HackingEasy
A web application is vulnerable to Cross-Site Scripting (XSS). An attacker injects a malicious script into a user's comment, which, when viewed by other users, executes in their browser and sends their session cookies to the attacker's server. Which type of XSS attack is this?
- ADOM-based XSS
- BUniversal XSS (UXSS)
- CReflected XSS
- DStored XSS
Show answer & explanationAnswer & explanation
Correct answer: D. Stored XSS
The scenario describes a malicious script being permanently stored (e.g., in a database as a comment) and then served to other users whenever they view that content. This is the definition of Stored XSS.
Why the other options are wrong
- A. DOM-based XSS involves client-side script modifying the DOM based on user input, without server interaction.
- B. UXSS refers to XSS vulnerabilities in the browser itself, not specifically in a web application.
- C. Reflected XSS occurs when malicious script is echoed back from the server in the response and executed in the user's browser, usually via a crafted URL.
Stored XSS
Stored (or Persistent) XSS is a type of Cross-Site Scripting attack where a malicious script is permanently stored on the target server (e.g., in a database) and delivered to other users.
- The most damaging type of XSS due to its persistence.
- Attacker injects script into databases, forums, comment fields, etc.
- Users execute the script unknowingly when they retrieve the compromised data.
Memory trick: Scripts Steal Secrets, Severely.