DOM‑based Cross‑Site Scripting

DOM‑based XSS occurs when the client‑side script processes user input and writes it directly back to the DOM. In Juice Shop, the search function reflects HTML without sanitisation, allowing attackers to execute arbitrary JavaScript in the browser.

Sample payloads:

<svg/onload=alert('DOMXSS')>
<img src="x" onerror="document.body.innerHTML='Hacked!'">