クロスサイトスクリプティング DOM location.href - yujitounai/helloworld GitHub Wiki
location.hrefをそのままhtmlとして表示するDOM based XSS モダンなブラウザだとURLエンコードされてるのでdecodeURI()されてる必要があってそんなものは希有
<!DOCTYPE html>
<head>
<meta charset="UTF-8" >
</head>
<body>
<div class="box">postMessageのXSS<br>
<form method="get" action="">search
<input name="word" type="text">
<input type="submit">
</form>
<span id="ads">
SECRET data is here
</span>
<script>
document.getElementById('ads').innerHTML = decodeURI(location.href);
</script>
</div>
</body>
</html>
http://localhost:9001/xss-locationhref.html?word=%3Ciframe%20src=%22%22%20onload=%22alert(1)%22%3E