クロスサイトスクリプティング 07 - yujitounai/helloworld GitHub Wiki
<script>
タグだけ除去するXSS
<?php
$word=filter_input(INPUT_GET, 'word');
$word=preg_replace('/<script>/i','',$word);
$word=preg_replace('/<\/script>/i','',$word);
echo "<h1>".$word."</h1>";
?>
<form method="get" action="">search
<input name="word" type="text">
<input type="submit">
</form>
xss-07.php?word="><script>alert(1)</script>