A web developer finds that client-side script writes attacker-controlled data into the page so the payload runs entirely in the browser without a server round trip. Which cross-site scripting type is this?
- AStored cross-site scripting
- BReflected cross-site scripting
- CServer-side request forgery
- DDOM-based cross-site scripting
DOM-based XSS occurs when client-side JavaScript writes attacker-controlled data into the page unsafely, so the payload executes in the DOM without the server reflecting it. Safe DOM APIs and encoding prevent it.
Why each option is right or wrong.
- D (correct). A payload executed via client-side script handling is DOM-based XSS.
- A. Stored XSS persists on the server and is served to users.
- B. Reflected XSS bounces the payload from the server response.
- C. Server-side request forgery makes the server send requests, not XSS.
Reference: CEH v13 Module 14 - Hacking Web Applications (Perform Injection/Input Validation Attacks).