Security Operations
After a user clicks a crafted link, a script runs in their browser. Server logs show the malicious string sat in the URL fragment and never reached the server. Page JavaScript copied it into the DOM. Which vulnerability is this?
Show the answer
Correct answerD. DOM-based XSS
AWhy not this: this attack forges a request using the victim's session and does not run attacker script in the page.
BWhy not this: reflected XSS needs the server to echo the input in its response, but the string never reached the server.
CWhy not this: stored XSS needs the payload saved on the server and served to later visitors, and nothing was saved.
DWhy this is right: client-side script inserted untrusted fragment data into the DOM with no server involvement.
DOM-based XSS happens entirely client-side: the page's own JavaScript writes untrusted data, here the fragment, into the DOM unsafely. Reflected XSS also needs a crafted link, but the server must echo the input back, and the logs show it never did.