クロスサイトスクリプティング 08 - yujitounai/helloworld GitHub Wiki
JavaScript内書き出しのXSS
<?php
$user=htmlspecialchars(filter_input(INPUT_GET, 'user'));
?>
<script>
document.write ('ようこそ'+'<?php echo $user; ?>'+"さん");
</script>
<form method="get" action="">login<br>
username<input name="user" type="text" value="<?php echo $user; ?>"><br>
password<input name="pass" type="password" value=""><br>
<input type="submit" value="ログイン">
</form>
/xss-08.php?user=user%27);alert(1)//